Quick Start
Steps to start using ClientSession with the minimum of fuss:
-
Download the clientsession.jar and make sure it it in your server's classpath.
-
Ensure the jakarta commons codec library is in your server's classpath.
-
Create and configure a SessionManager:
KeyPair pair = //get key pair;
SessionManager sessionManager = new FullSessionManager();
sessionManager.enableSigning(keyPair, "SHA1withDSA");
-
Use the SessionManager to create a new session for a client:
ClientSession session = sessionManager.createSession();
-
Marshal the session to a string representation:
String sessionString = sessionManager.marshall(session);
-
Embed the string in the output page to be resubmitted with the next request. For example, the string could be stored in a hidden field on a form
-
When the page is submitted, unmarshall the string back to a session:
ClientSession session = sessionManager.unmarshall(sessionString);