This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

strange cookie behaviour

 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.

avi sinha
ch62.zip.jpg
[Thumbnail for ch62.zip.jpg]
web-app
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Avi. Here the default 'JSESSIONID' cookie will not available after restarting the browser.

Use
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks chinmaya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic