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 the setAttribute(String, Object, HttpServletRequest, HttpServletResponse, boolean) or removeAttribute(String, HttpServletRequest, HttpServletResponse) methods before the associated HttpServletResponse response is committed.
  • Constructor Details

    • SessionStateSupport

      public SessionStateSupport()
  • Method Details

    • setAttribute

      @Deprecated public void setAttribute(String name, Object value, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
      Parameters:
      name - the name of the attribute
      value - the attribute value
      req - HTTP request
      resp - 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 attribute
      value - the attribute value
      req - HTTP request
      resp - HTTP response
      usedAsLoginCtx - 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 attribute
      req - HTTP request
      resp - 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 attribute
      req - HTTP request
      resp - HTTP response
      Returns:
      the attribute value