java.lang.Object
dev.katsute.simplehttpserver.HttpSessionHandler
The session handler is used to assign sessions to exchanges.
- Since:
- 5.0.0
- Version:
- 5.0.0
- Author:
- Katsute
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a session handler using the cookie__session-id
.HttpSessionHandler
(String cookie) Creates a session handler using a specified cookie. -
Method Summary
Modifier and TypeMethodDescriptionassignSessionID
(HttpExchange exchange) Assigns a unique session ID to an exchange.final HttpSession
getSession
(HttpExchange exchange) Returns the session associated with a particular exchange.toString()
-
Constructor Details
-
HttpSessionHandler
public HttpSessionHandler()Creates a session handler using the cookie__session-id
.- Since:
- 5.0.0
-
HttpSessionHandler
Creates a session handler using a specified cookie.- Parameters:
cookie
- cookie to use for session ID- Since:
- 5.0.0
-
-
Method Details
-
assignSessionID
Assigns a unique session ID to an exchange.- Parameters:
exchange
- http exchange- Returns:
- unique session ID
- Since:
- 5.0.0
-
getSession
Returns the session associated with a particular exchange.- Parameters:
exchange
- http exchange- Returns:
- session associated with exchange
- Since:
- 5.0.0
-
toString
-