This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i have set the age to be 60*60. but whenever i restart the browser it gives the status new-user.
i have checked the settings in the browser which says "keep cookies until they expire ".
i checked the cookie folder after restarting and found the cookie with the previous value but the previous value is replaced while accessing the page.
what is the reason???
is anything wrong in the code???
i am uploading the app too. if anybody can help... its a zipped file with the extension jpg. moderators, if this is not allowed here please notify me.
Chinmaya Chowdary wrote:Hi Avi. Here the default 'JSESSIONID' cookie will not available after restarting the browser.
i didn't get your point.please make it a bit more clear.
Joined: Apr 21, 2008
Hi Avi. If we say the container first checks is there any cookie with name JSESSIONID, if found it gets the session id from that cookie and checks is there any session object associated with this id. If yes, it reuses that session object, if no creates new session object like and the response will be sent to the client. Now client is having JSESSIONID cookie, here the JESSIONID cookie time set was '-1' means the cookie will expire if we close the browser. After if we restart it will not present, so we are not able to communicate with the container. Here container creates new session object, get id from it, creating cookie object, setting time period, adds to the response object. This is default behaviour. If we set cookie time we know it will not expire after exiting the browser. It will stay for 1 hour at the client side.