English 中文(简体)
Can two different browser share one cookie?
原标题:

My requirement is pretty interesting, I want to maintain one cookie between two different browser for same domain.

so lets say I have create one cookie with name "mydata" and value "hiscal" from IE, then if i browse same website from firefox and trying to read cookie "mydata" then system should give me value "hiscal"

but this is not happen in general case

so can any one tell me how i can share cookie between to different browser(client) of same domain.

Thanks, Hiscal

最佳回答

You can build a cookie-proxy by creating a Flash application and use Shared Objects (SO = Flash cookies) to store data.

Any Browsers with Flash installed could retrieve the informations stored in the SO.

But, it s an ugly workaround.

Just don t share cookies... and find another way to build your website/app.

问题回答

Every browser maintains it s own cookies. So in general, no this is not possible.

With a lot of hard work you could in theory write an application that sits on the client computer that looks at all the locations the different browsers store cookies, parses the different cookie formats, synchronises them and then writes them out.

That would be error prone and will break as soon as a browser changes how it works with cookies (not to mention that some of the browsers secure their cookies, so you won t be able to get to them in the first place).

In my opinion, this is not practical and I wouldn t even try.

Use YUI s storage utility and force it to use the SWF storage engine.

All computers and browsers would still have to have Flash installed, but you wouldn t have to write your own Flash app. You would benefit from using the one maintained by the YUI team.

As others have said, this is not very portable, but in a controlled environment, it might work for you.

Cookies can be shared with other data storage, through browser extensions. Maybe in Flash or Google Gears you can maintain shared DB between browsers, but it needs to be installed on both of them, of course.

Edit:

In Google Gears you can t. Maybe you should write self-made extension... or some user-login system, where the data will sit on the server.





相关问题
How to suppress/remove PHP session cookie

I need to suppress an already set session cookie header, but I cannot find any way to do this. Why? I need to make an image, sent by a PHP script, cacheable by the end user; this image is used to ...

Remove Cookies from JS or CSS files

Bizarrely my javascript and css files have cookies (says Firebug). I use Zend Framework and I think it has to do with it. Could I change the .htaccess that CSS or JS files don t link to the ZF or is ...

httplib2, how to set more than one cookie?

As you are probably aware, more often than not, an HTTP server will send more than just a session_id cookie; however, httplib2 handles cookies with a dictionary, like this: response, content = http....

cookies control

what tool wold you recommend me to use in order to see what data are stored in my cookies while i m browsing the net. I m a beginner into webdev field(6 months php experience) and i m curious to see ...

热门标签