Can a session cookie be set in Javascript so only that browser instance sees it?
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).
精彩评论