How can I determine whether the browser accessing my JSP page supports cookies?

Alessandro A. Garbagnati

Considering that it is JSP, in the first page just check if the cookie named JSESSIONID is present. That's the standard name defined in the Servlet Specification for the cookie that supports the session identifier. If that cookie can be read, your browser supports cookies. Else, you need to start encoding the session ID within the URL with HttpServletResponse.encodeURL() and HttpServletResponse.encodeRedirectURL().

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact