Originally posted by Sudipto Shekhar:
Hello,
...
...
Originally posted by Sudipto Shekhar:
How do we verify further whether the user is from a particular session?
Correct me if I am wrong A cookie is associated with a particular session, which can carry a small amount of data back and forth the server and client and is stored at the client side.
So how is cookie used for managing sessions?
When and how does 'JSESSIONID' comes into play for session handling?
Steve
When a session is first made for a user, the server adds a JSESSIONID cookie to the response with a unique ID to associate a session with the user.
Originally posted by Sudipto Shekhar:
Ok.
How do I associate a particular user to a session? I am sorry, i did not get this?
Or a particular user remains in his session until the session expires or when the session is invalidated ?
Originally posted by Sudipto Shekhar:
Why don't i get the cookie named JSESSIONID from the array of Cookies sent from the client when it iterate through the array,and using if(cookie.getName().equals("JSESSIONID")) cookie.getValue()?
Originally posted by Sudipto Shekhar:
So you mean to say I do not have to keep the track of which user is of a particular session!
A user is associated to his own session and this is done by the container, with the help of 'JSESSIONID' named cookie.
Each time a new request comes to the server and a new session is created "HttpSession session=request.getSession();" the container adds a cookie to response named 'JSESSIONID'.
So when the user has travelled through several pages in the application he is in his session and it is maintained by the container.
Correct?
Please correct me if i am wrong somewhere in understanding you.
Thank you very much Steve for your help.
Steve
Originally posted by Steve Luke:
sessions are maintained by cookies and the server handles all the IDs / session lookup stuff for you. All you have to do is call request.getSession();
Die Fledermaus does not fear such a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|