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
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)
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?
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.
精彩评论