Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happen if Cookie 'Expires/Max-Age' is 'N/A' or not set

I tried to increase the cookie expiry time and activated sliding expiry.

But the cookie expiry is still "N/A"

what problems will it cause, why expiry is not shown. In this case what will happen to cookie. when will it expire.

enter image description here

like image 391
Arun Prasad E S Avatar asked Apr 19 '19 01:04

Arun Prasad E S


People also ask

What happens when cookies expire?

Cookies with an expiration date in the past will be removed from the browser. To remove a cookie, you must set it's set its expiration date in the past. This will signal to the browser that the cookie should be removed.

What is Max-age in set cookie?

maxAge. Set the cookie "Max-Age" attribute. A positive value indicates when the cookie should expire relative to the current time. A value of 0 means the cookie should expire immediately.

Is it possible to set a cookie without an expiration date?

YOU JUST CAN'T. There's no exact code to use for setting a forever cookie but an old trick will do, like current time + 10 years . Just a note that any dates beyond January 2038 will doomed you for the cookies (32-bit int) will be deleted instantly.

How do you set an expired cookie?

You can extend the life of a cookie beyond the current browser session by setting an expiration date and saving the expiry date within the cookie. This can be done by setting the 'expires' attribute to a date and time.


1 Answers

It means the cookie will expire at the end of the session (when the browser closes, but not always).

When user privacy is a concern, It is important that any web app implementation will invalidate cookie data after a certain timeout and won't rely on the browser clearing session cookies.

One of the most beloved features of Firefox prevents session cookies from ever expiring. The same issue is also occuring with google chrome (and probably with other browsers offering similar features)

like image 84
fromvega Avatar answered Nov 15 '22 07:11

fromvega