Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setcookie syntax Google Chrome

Tags:

I am using following syntax to set cookie:

Set-Cookie:Cookie-name=value; path=/; Max-Age=1296000; HttpOnly

In google chrome console it is showing Invalid Date for that cookie.

What is wrong in the syntax ?

According to http://en.wikipedia.org/wiki/HTTP_cookie#Expires_and_Max-Age http://tools.ietf.org/html/rfc6265#section-5.2.2 I can use Max-Age to specify relative expiration time.

like image 553
Vivek Goel Avatar asked Feb 13 '12 05:02

Vivek Goel


1 Answers

I don't think it is something which you could/should solve. The Inspector/Dev tool that you are using is not always right as shown by the other user. There are other cases where the Dev tool is wrong too, like in "network" tool.
You could install an extension like edit this cookie to find out how your cookies are behaving. Although it doesn't help you track across redirects, it helps knowing what cookies are set up and allows you to change it too.

like image 91
Shrinath Avatar answered Oct 05 '22 09:10

Shrinath