Tracking Session Information When Cookie Is Disabled

What is the simplest way to keep track of session information if the cookie is disabled in the client? Even though we have other alternative solutions like passing the session ID in the query string or passing the session ID through a hidden variable, the simplest way is to encode the URL with the session ID. Wherever the URL is used, use the following syntax to encode the URL, then display or store it. The usage is:

 <%= HttpServlet.response.encodeURL("/URL here") %>.Incase of redirecting the page, the syntax is<%= HttpServlet.response.encoderedirectURL("/URL here") %>

Now, in your JSP or servlet, you can retrieve the session ID and perform the calculation respective to the client.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: