This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes cookie.getMaxAge reads -1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "cookie.getMaxAge reads -1" Watch "cookie.getMaxAge reads -1" New topic
Author

cookie.getMaxAge reads -1

martin brow
Greenhorn

Joined: Dec 13, 2011
Posts: 3
Hello,

I'm using cookies for my site, and for debugging I need to see how long cookies are alive to determine whether I should extend their life time or not. The code to create a cookie: (in a login.java)

And to read it out:


But, age reads always -1 (it does die however after 60 seconds, so the setMaxAge(60) works) and path reads "null". The getName and getValue do work, and I can adjust them perfectly... What is wrong with my getPath and getmaxAge()?

thanks for any help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cookie.getMaxAge reads -1
 
Similar Threads
HTML display
Why isn't my cookie being set?
unable to reset cookie max age
JSP - cookie not processing as it should
change cookie value