Reputation: 261
Is it possible in Javascript to save your own cookies that relate to a particular site "www.example.com" and then you can reuse them in another browser?
For example: I save cookies for site "www.example.com" using Javascript in Chrome. I open Firefox and using Javascript I load these cookies and use them.
Upvotes: 0
Views: 957
Reputation: 3350
Directly no. But you could make a proxy. The scenario is:
in php you can get all cookies using:
print_r($_COOKIE)
If your domain will send this header, your cookies will be avaliable from every domain:
header('Content-type: text/html');
header('Access-Control-Allow-Origin: *');
It's not possible to read other domains cookies without their knowledge. If it would be possible it would be security thread. (ex. spam websites read your login information from facebook.com)
Upvotes: 2
Reputation: 1044
Every browser saves its cookies to his own cookie directory. They usually don't share this with each other, altough you may could set up each browser individually to use one shared cookie directory in which each browser saves its cookies.
As a cookie is nothing else than a text file, each browser should be able to read this if there is no particular difference in the implementation of how the browser saves the cookie to the file system.
If the cookies are compressed or written in other encoding types for example, it won't work.
Upvotes: 0
Reputation: 22421
There's no JavaScript facilities that are shared between different browsers. You need to use some other storage like Flash for that.
Upvotes: 0