Reputation: 3391
If I open a new window in a browser, from the same computer I opened the last one, will it set up a new empty $_SESSION or will it use the one created by the last script I ran on this computer? Of-course both browser windows are running the same script..
If not, how can I do that?
If I work on two different browsers, will they share the session?
Thanks
Upvotes: 1
Views: 1022
Reputation: 9671
New Windows (or Tabs) will use the same session.
You can prevent this by using the 'Private browsing' or 'Incognito' mode in newer Browsers. This will get you a fresh environment every time.
If you are on OSX, I can recommend Stainless (http://www.stainlessapp.com/) which uses the webkit engine and handles individual sessions within different tabs (See application preferences)
Upvotes: 2
Reputation: 9902
That depends. How are you handling the session id? Via the URL or cookies? If via cookies, are you setting them to live only until the browser closes, or until a certain time, or until a certain future time?
Upvotes: 2
Reputation: 20240
It will use the same session. Opening a new window is for the server the same as you would open it in the original window.
Upvotes: 1