Mask
Mask

Reputation: 34197

About cookie expiration

If I set cookie to expire in 1 month.

But during that month,I visit the site every day.

Will the cookie still expire after 1 month?

Upvotes: 1

Views: 523

Answers (2)

bbb
bbb

Reputation: 702

It depends on how you set your cookie - if you set it according to the algorithm:

expiration date = today date + 30 days

then yes, every visit (assuming you recreate the cookie every time) will of course result in cookie expiration date being extended. If you have some conditions on which the cookie is not recreated (e.g. only checking if it exists), it might be the other way. For more detailed advice you should post a sample of your code.

Upvotes: 3

treaschf
treaschf

Reputation: 5944

The expiration date is stored in the cookie as a simple date, like 25th Dec 2009. You will have to recreate that cookie (in other words to renew it), if you do not want it to expire after the first month.

Upvotes: 3

Related Questions