Previous Topic: Constructor for Session Scheme API

Next Topic: Configure Custom Session Scheme in the server.conf File

Session Scheme API Methods

The session scheme API class consists of the following methods:

Return Value

Method

Notes

Boolean

acceptsCookies()

Retrieves the value of the acceptFlag from the accepts_smsession_cookies parameter of the session scheme in the server.conf file and returns a value indicating whether this scheme supports SiteMinder SMSESSION cookies.

abstract java.lang.String

createKeyFromRequest(HttpServletRequest req)

Executes code to retrieve values needed to create a new session key from the request.

abstract java.lang.String

getKeyFromRequest(HttpServletRequest req)

Retrieves the session key from a request.

java.lang.String

getName()

Retrieves the name of the custom session scheme as defined in the server.conf file.

abstract Boolean

isValidRequest(HttpServletRequest req)

Evaluates if the request for this session scheme is valid.

abstract int

onSessionCreate(java.lang.String id, HttpServletRequest req,
HttpServletResponse resp)

Hook that is available on the event of session creation.

java.lang.String

onSessionCreateRedirect(java.lang.String id, java.lang.String url, HttpServletRequest req, HttpServletResponse resp)

Hook that is available on the event of session creation for rewritable schemes.

abstract void

onSessionLogOut(HttpServletRequest req,
HttpServletResponse resp)

Hook that is available at the event of a session termination (logout).

abstract void

onSessionUpdate(HttpServletRequest req, HttpServletResponse resp)

Hook that is available on the event of session updates. This method is only for internal use.

static Boolean

usingDefaultSessionScheme(HttpServlet
Request req)

Helper method for recognizing that a request is using the default session scheme.

Implement a Custom Session Scheme

Use the following procedure to implement a custom session scheme.

To implement a custom session scheme using the session scheme API

  1. Review the sample code for the IP address session scheme in IP Address Session Scheme.
  2. Write source code for your session scheme.
  3. If you are creating a rewritable session scheme, you must implement the rewritable interface.
  4. Ensure that your system CLASSPATH includes the following:
  5. Compile the session scheme.
  6. Do one of the following:
  7. Restart the SPS.