开发者

Can a session cookie be set in Javascript so only that browser instance sees it?

开发者 https://www.devze.com 2023-02-15 09:38 出处:网络
Is there a way to set a browser session cookie in Javascript, so that only that browser instance c开发者_C百科an see that cookie.For example, if I set a cookie via Javascript in one instance of Firefo

Is there a way to set a browser session cookie in Javascript, so that only that browser instance c开发者_C百科an see that cookie. For example, if I set a cookie via Javascript in one instance of Firefox, and then invoke a second instance of Firefox (Ctrl-N or launching firefox.exe again), I do not want that second instance to be able see this cookie.

How would I go about this? Thank you.


You can't. Different browser windows are just different windows to the same instance. Launching Firefox again just spots the running instance and opens a new window in it.

(There are some command line options which might open a new instance (in particular the one to load a different user profile), but that is entirely a client issue and any JS is by the by).

0

精彩评论

暂无评论...
验证码 换一张
取 消