Jithin Jose
Jithin Jose

Reputation: 1821

Javascript document.cookie not working with custom path

The following statement working and it setting the cookie.

document.cookie = "vcrcjode=118b11a9b3; expires=Sat, 
                   02 Nov 2013 21:23:59 GMT; path=/";

But the same statement with different path not working.

document.cookie = "vcrcjode=118b11a9b3; 
                   expires=Sat, 02 Nov 2013 21:23:59 GMT; path=/tag/";

Both statement not generating any errors. Why second statement not working?

Upvotes: 2

Views: 3091

Answers (1)

Jithin Jose
Jithin Jose

Reputation: 1821

When i tested above code i was testing from Console in Google Chrome.

Both statement is setting the cookie but it only show in console when we navigate to /tag/ directory.

Upvotes: 2

Related Questions