Mason Wright
Mason Wright

Reputation: 367

How to make universal cookie

How would I make cookie that can be accesed by any website in javascript? Or how can I make a cookie that can be accesed by any website that has my domain name?

Upvotes: 1

Views: 530

Answers (2)

maxTrialfire
maxTrialfire

Reputation: 551

You can't. That would violate browser security.

Upvotes: 0

jwiz21
jwiz21

Reputation: 38

Unless you have a specific reason to use cookies, I would use localStorage. It is easy to use and can either be accessed by the domain name or the web browsers themselves. Also localStorage has a bigger memory then cookies.

Upvotes: 2

Related Questions