aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Cookie lifetime Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply 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: 14672
    
  11

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: 8795

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, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4725

Foreeeeever young. I want cookies foreeeeeever young.


A good workman is known by his tools.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Cookie lifetime
 
Similar Threads
expire cookie
Cookie
Deleting non-persistent Cookie
Cookie
problem in cookie