Omer Aviv
Omer Aviv

Reputation: 284

Setting a cookie's value without changing the expiration date

I have some cookie that obviously keeps some information. I want to set its value, but keep the expiration date as it is (as not changing it at all). Is there an easier way than saving the expiration date on another cookie and then read from it? I tried searching and this is the only solution I found, but am quite sure there are other ways.

Upvotes: 1

Views: 165

Answers (1)

paullb
paullb

Reputation: 4325

It isn't possible using the PHP functionality, but there is a workaround.

You can do this is to read in the original expiry date and when you set the cookie match it up so that the expiration date hasn't changed.

Upvotes: 3

Related Questions