@Singleton public class CookieSessionMapper extends Object implements SessionMapper
Implement SessionMapper with HTTP cookie
SessionMapper.ExpirationMapper| Constructor and Description |
|---|
CookieSessionMapper(AppConfig conf) |
| Modifier and Type | Method and Description |
|---|---|
String |
readFlash(org.osgl.http.H.Request request)
Read the incoming HTTP request and extract serialized flash state.
|
String |
readSession(org.osgl.http.H.Request request)
Read the incoming HTTP request and extract serialized session state.
|
void |
write(String session,
String flash,
org.osgl.http.H.Response response)
Write serialized session and flash state into
response. |
void |
writeExpiration(long expiration,
org.osgl.http.H.Response response)
Write session expiration date/time into
response. |
@Inject public CookieSessionMapper(AppConfig conf)
public void writeExpiration(long expiration,
org.osgl.http.H.Response response)
SessionMapperWrite session expiration date/time into response.
The expiration will use date time format as specified in rfc-7231
writeExpiration in interface SessionMapperexpiration - the expiration in millisecondsresponse - the response to which the expiration to be writtenpublic void write(String session, String flash, org.osgl.http.H.Response response)
SessionMapperWrite serialized session and flash state into response.
write in interface SessionMappersession - the session state (a string) to be written to the responseflash - the flash state (a string) to be written to the responseresponse - the HTTP responsepublic String readSession(org.osgl.http.H.Request request)
SessionMapperRead the incoming HTTP request and extract serialized session state.
readSession in interface SessionMapperrequest - the incoming HTTP requestnull if not session state found in the request using this mapperpublic String readFlash(org.osgl.http.H.Request request)
SessionMapperRead the incoming HTTP request and extract serialized flash state.
readFlash in interface SessionMapperrequest - the incoming HTTP requestnull if not flash state found in the request using this mapperCopyright © 2014–2018 ActFramework. All rights reserved.