JSP Session Handling

Hi Experts,

I would like to check whether a client machine is supporting sessions or not. If not, what would be the best way to handle sessions in JSP? I further need to know, how i can maintain sessions using URL Rewriting.

Awaiting for your comments.

Regards,
Vijay T. Prabakar
CIPL-SenthilAsked:
Who is Participating?
 
Tomas Helgi JohannssonConnect With a Mentor Commented:

Take a look at this example :
http://www.java2s.com/Code/Java/Servlets/Usecookietosavesessiondata.htm

Regards,
  Tomas Helgi
0
 
Tomas Helgi JohannssonCommented:
  Hi!

Take a look at this example http://www.java2s.com/Code/Java/JSP/Sessionsdisabled.htm and the related examples.
Hope it helps.

Regards,
  Tomas Helgi
0
 
jpolin1Commented:
I think your really looking to determine if a client supports cookies, if they don't then you would want to use url rewriting.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
CIPL-SenthilAuthor Commented:
Yeah! If there is no support for cookies, I would like to switch to URL rewriting. Can anybody provide some information about this.
0
 
Tomas Helgi JohannssonCommented:
0
 
CIPL-SenthilAuthor Commented:
Hi,

Can you provide me the code to check cookies are supported, if not how to URL Rewrite?
0
 
CIPL-SenthilAuthor Commented:
Hi,

I would like to have an web application which automatically enables URL Rewritting whenever cookies are not supported on the client machine. I saw some articles on URL Rewritting which speaks about adding the session id to the URL.

I would like to know, is it possible to track the other session variables just by having the session id in the URL or would I have to add every session variable along with the URL.

Please advice.

Regards
Vijay T. Prabakar
0
 
Tomas Helgi JohannssonCommented:

You would have to add every session variable to the url if you can't write a cookie.

Regards,
  Tomas Helgi
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.