Search code examples
servletscookiesauthenticationhttpsessionjsessionid

Servlet HttpSession cookies disabled


In a web app, when user logs in, a HttpSession is created using HttpSession s = request.getSession(true); This creates a cookie with jsessionid on the browser. But if cookies are disabled on browser, How can i proceed with login?


Solution

  • If Cookies are disabled. You should be using URL Rewriting mechanism for Session tracking.

    Code Example:

    http://www.javadocexamples.com/javax/servlet/http/HttpServletResponse/encodeURL%28String%20url%29.html