public class BroadleafCookieHttpSessionStrategy extends Object implements HttpSessionManager, MultiHttpSessionStrategy, org.springframework.session.web.http.HttpSessionIdResolver
SessionRepositoryFilter.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ALIAS |
static String |
DEFAULT_SESSION_ALIAS_PARAM_NAME |
| Constructor and Description |
|---|
BroadleafCookieHttpSessionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
String |
encodeURL(String url,
String sessionAlias)
Provides the ability to encode the URL for a given session alias.
|
void |
expireSession(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
String |
getCurrentSessionAlias(javax.servlet.http.HttpServletRequest request)
Gets the current session's alias from the
HttpServletRequest. |
String |
getNewSessionAlias(javax.servlet.http.HttpServletRequest request)
Gets a new and unique Session alias.
|
String |
getRequestedSessionId(javax.servlet.http.HttpServletRequest request) |
Map<String,String> |
getSessionIds(javax.servlet.http.HttpServletRequest request)
Gets a mapping of the session alias to the session id from the
HttpServletRequest. |
List<String> |
resolveSessionIds(javax.servlet.http.HttpServletRequest request) |
void |
setCookieSerializer(org.springframework.session.web.http.CookieSerializer cookieSerializer)
Sets the
CookieSerializer to be used. |
void |
setDeserializationDelimiter(String delimiter)
Sets the delimiter between a session alias and a session id when deserializing a
cookie.
|
void |
setSerializationDelimiter(String delimiter)
Sets the delimiter between a session alias and a session id when deserializing a
cookie.
|
void |
setSessionId(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sessionId) |
javax.servlet.http.HttpServletRequest |
wrapRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Allows customizing the
HttpServletRequest. |
javax.servlet.http.HttpServletResponse |
wrapResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Allows customizing the
HttpServletResponse. |
public static final String DEFAULT_ALIAS
public static final String DEFAULT_SESSION_ALIAS_PARAM_NAME
public List<String> resolveSessionIds(javax.servlet.http.HttpServletRequest request)
resolveSessionIds in interface org.springframework.session.web.http.HttpSessionIdResolverpublic String getCurrentSessionAlias(javax.servlet.http.HttpServletRequest request)
HttpSessionManagerHttpServletRequest.getCurrentSessionAlias in interface HttpSessionManagerrequest - the HttpServletRequest to obtain the current session's alias
from.public Map<String,String> getSessionIds(javax.servlet.http.HttpServletRequest request)
HttpSessionManagerHttpServletRequest.getSessionIds in interface HttpSessionManagerrequest - the HttpServletRequest to obtain the mapping from. Cannot be
null.HttpServletRequest. Cannot be null.public String getRequestedSessionId(javax.servlet.http.HttpServletRequest request)
public String getNewSessionAlias(javax.servlet.http.HttpServletRequest request)
HttpSessionManagerHttpSessionManager#encodeURL(java.lang.String). For example:
String newAlias = httpSessionManager.getNewSessionAlias(request);
String addAccountUrl = httpSessionManager.encodeURL("./", newAlias);
getNewSessionAlias in interface HttpSessionManagerrequest - the HttpServletRequest to get a new alias frompublic javax.servlet.http.HttpServletRequest wrapRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
MultiHttpSessionStrategyHttpServletRequest.wrapRequest in interface MultiHttpSessionStrategyrequest - the original HttpServletRequest. Cannot be null.response - the original HttpServletResponse. This is NOT the result of
MultiHttpSessionStrategy.wrapResponse(HttpServletRequest, HttpServletResponse) Cannot be null. .HttpServletRequestpublic javax.servlet.http.HttpServletResponse wrapResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
MultiHttpSessionStrategyHttpServletResponse.wrapResponse in interface MultiHttpSessionStrategyrequest - the original HttpServletRequest. This is NOT the result of
MultiHttpSessionStrategy.wrapRequest(HttpServletRequest, HttpServletResponse). Cannot be null.response - the original HttpServletResponse. Cannot be null.HttpServletResponsepublic String encodeURL(String url, String sessionAlias)
HttpSessionManagerencodeURL in interface HttpSessionManagerurl - the url to encode.sessionAlias - the session alias to encode.public void setDeserializationDelimiter(String delimiter)
delimiter - the delimiter to set (i.e. "_ " will try a delimeter of either "_"
or " ")public void setSerializationDelimiter(String delimiter)
delimiter - the delimiter to set (i.e. "_")public void setCookieSerializer(org.springframework.session.web.http.CookieSerializer cookieSerializer)
CookieSerializer to be used.cookieSerializer - the cookieSerializer to set. Cannot be null.public void setSessionId(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sessionId)
setSessionId in interface org.springframework.session.web.http.HttpSessionIdResolverpublic void expireSession(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
expireSession in interface org.springframework.session.web.http.HttpSessionIdResolverCopyright © 2021. All rights reserved.