wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Cookie lifetime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Cookie lifetime" Watch "Cookie lifetime" New topic
Author

Cookie lifetime

Renu Radhika
Ranch Hand

Joined: Oct 21, 2005
Posts: 243
This is from the Cookie API.

"A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age.

A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted."


But I want to know how we can make the cookie live forever.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

But I want to know how we can make the cookie live forever

You can set its life time to the biggest value. I let you calculate how many years the maximum "int" value represents


[My Blog]
All roads lead to JavaRanch
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9521
    
    2

One example for this is our Javaranch where you log in once and every time you visit, you are automatically logged in and this stayed on my machine for more than 6 months and it continues. Am I right Christoph?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Foreeeeever young. I want cookies foreeeeeever young.


A good workman is known by his tools.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Cookie lifetime