MCPcopy Index your code
hub / github.com/AgentOps-AI/agentops / _encode_session_cookie

Function _encode_session_cookie

app/api/agentops/auth/views.py:139–147  ·  view source on GitHub ↗

Encode the session as a JWT for use in setting our own session cookie. Currently this just includes the session_id in order to avoid storing any sensitive information in the cookie.

(session: Session)

Source from the content-addressed store, hash-verified

137
138
139def _encode_session_cookie(session: Session) -> str:
140 """
141 Encode the session as a JWT for use in setting our own session cookie.
142
143 Currently this just includes the session_id in order to avoid storing any
144 sensitive information in the cookie.
145 """
146 session_id = str(session.session_id)
147 return jwt.encode({"session_id": session_id}, AUTH_COOKIE_SECRET, algorithm=AUTH_JWT_ALGO)
148
149
150def _decode_session_cookie(cookie: str) -> Session | None:

Callers 1

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…