java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
net.i2p.router.web.servlets.SessionCheckServlet
- All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Lightweight session validation endpoint for AJAX polling. Returns 200 if session is valid, 401 if expired/invalid. Returns 200 if no password is configured (no auth required).
- See Also:
Constructor Summary
ConstructorsConstructorDescriptionA stateless endpoint: the password configuration and the session token are read from each request, so a bare instance is ready to serve.Method Summary
Private MethodsModifier and TypeMethodDescriptionprotected voiddoGet(HttpServletRequest req, HttpServletResponse resp) private StringThe session cookie the request carries.private booleanTrue if any console password is configured.Methods inherited from class HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceMethods inherited from class GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
Constructor Details
SessionCheckServlet
public SessionCheckServlet()A stateless endpoint: the password configuration and the session token are read from each request, so a bare instance is ready to serve.
Method Details
doGet
- Overrides:
doGetin classHttpServlet- Throws:
IOException
hasAnyPassword
private boolean hasAnyPassword()True if any console password is configured.- Returns:
- true if a password exists
getSessionCookie
The session cookie the request carries.- Parameters:
req- the request to read- Returns:
- the cookie value, or null if absent