arxiv.users.legacy.sessions module

Provides API for legacy user sessions.

arxiv.users.legacy.sessions.create(authorizations, ip, remote_host, tracking_cookie='', user=None)[source]

Create a new legacy session for an authenticated user.

Parameters:
  • user (User) –
  • ip (str) – Client IP address.
  • remote_host (str) – Client hostname.
  • tracking_cookie (str) – Tracking cookie payload from client request.
Returns:

Return type:

Session

Return type:

Session

Generate a cookie from a domain.Session.

Parameters:session (domain.Session) –
Returns:
Return type:str
Return type:str
arxiv.users.legacy.sessions.invalidate(cookie)[source]

Invalidate a legacy user session.

Parameters:cookie (str) – Session cookie generated when the session was created.
Raises:UnknownSession – The session could not be found, or the cookie was not valid.
Return type:None
arxiv.users.legacy.sessions.invalidate_by_id(session_id)[source]

Invalidate a legacy user session by ID.

Parameters:session_id (str) – Unique identifier for the session.
Raises:UnknownSession – The session could not be found, or the cookie was not valid.
Return type:None
arxiv.users.legacy.sessions.load(cookie)[source]

Given a session cookie (from request), load the logged-in user.

Parameters:

cookie (str) – Legacy cookie value passed with the request.

Returns:

Return type:

domain.Session

Raises:
Return type:

Session