Joe
Joe

Reputation: 4532

How to modify a existing cookie value for a specific domain using javascript?

I use this method to reset the cookie value but the method creates new cookie and modifies the same,

   document.cookie="leo_auth_token=" + cookievalue;

This does not set the value for the leo_auth_token i think since this cookie name comes under linkedin.com folder in cookies section.

so how to modify for a specific domain or under a folder like linkedin.com

Please help me how to go about.

Upvotes: 0

Views: 1221

Answers (1)

BenM
BenM

Reputation: 53198

You cannot set the value of a cookie defined on another domain. This would be a huge security risk, and there's a good reason why you can't do this!

You will need to find an alternative solution, I'm afraid.

Upvotes: 2

Related Questions