Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cookies expiration date

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi I'm beginig working with cookies in Java.

I have some weird behaviours. I'm learning with a testing cookie. First, I have set the expiration time of my test cookie (setMaxAge()) in the cookie creation before add it to the response. I need to recover the expiration date of the cookie later, but when I do, the method I guessed that was intended for this (getMaxAge()) always return -1;

Another think I don't understand it's that in spite of the -1 returned by getMaxAge() the cookie expires at correct time (internet explorer and firefox). Also I see the correct expiration date of the cookie with internet explorer (in temporary folder) but with firefox (cookies window wiew) it says that the cookie will expire at session ending (in spite of it expired in the set time).

Please help, I'm a bit annoyed about these behaviours.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I see that this is also posted in our Servlets forum, where it's more appropriate. Please do not post duplicates. People don't like taking time to respond and then find the same question has already been answered in another forum.
 
    Bookmark Topic Watch Topic
  • New Topic