Class SessionStateSupport
- java.lang.Object
-
- org.sourceid.saml20.adapter.state.SessionStateSupport
-
- Direct Known Subclasses:
ApplicationSessionStateSupport
public class SessionStateSupport extends Object
Provides functionality similar to using the HTTP Session. You can set, get and remove attributes associated with a user's session.
The advantage of using this rather than the HttpSession object is that it uses the PingFederate server's underlying implementation of inter-request state management to replicate or share the data in a clustered environment.
Attributes must be added or updated using thesetAttribute(String, Object, HttpServletRequest, HttpServletResponse, boolean)orremoveAttribute(String, HttpServletRequest, HttpServletResponse)methods before the associatedHttpServletResponseresponse is committed.
-
-
Constructor Summary
Constructors Constructor Description SessionStateSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ObjectgetAttribute(String name, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)Retrieves a named attribute from the user session (as determined by the request)ObjectremoveAttribute(String name, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)Removes a named attribute from the user session (as determined by the request)voidsetAttribute(String name, Object value, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)Deprecated.As of release 6.5, replaced bysetAttribute(String, Object, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean)voidsetAttribute(String name, Object value, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, boolean usedAsLoginCtx)Sets or associates a named attribute with the user session (as determined by the request)
-
-
-
Method Detail
-
setAttribute
@Deprecated public void setAttribute(String name, Object value, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Deprecated.As of release 6.5, replaced bysetAttribute(String, Object, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean)- Parameters:
name- the name of the attributevalue- the attribute valuereq- HTTP requestresp- HTTP response
-
setAttribute
public void setAttribute(String name, Object value, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, boolean usedAsLoginCtx)
Sets or associates a named attribute with the user session (as determined by the request)- Parameters:
name- the name of the attributevalue- the attribute valuereq- HTTP requestresp- HTTP responseusedAsLoginCtx- Instructs the underlying state mechanism (if appropriate) as to if certain mitigation steps against session fixation should be taken. Use true, if the attribute is used to maintain a security or login context, and false otherwise.- Since:
- 6.5
-
getAttribute
public Object getAttribute(String name, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Retrieves a named attribute from the user session (as determined by the request)- Parameters:
name- name the name of the attributereq- HTTP requestresp- HTTP response- Returns:
- the attribute value
-
removeAttribute
public Object removeAttribute(String name, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Removes a named attribute from the user session (as determined by the request)- Parameters:
name- name the name of the attributereq- HTTP requestresp- HTTP response- Returns:
- the attribute value
-
-