Re: Why are Session Variables carried over into a brand new browser window?
| From: | Torsten Roehr | Date: | Sun, 18 Apr 2004 08:40:15 +0000 |
| Subject: | Re: Why are Session Variables carried over into a brand new browser window? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183757@lists.php.net to get a copy of this message | ||
"Bob Bruce - Programmer" <covariance@shaw.ca> wrote in message
news:000601c424e5$3a83e690$3ba44d18@cs41617a...
> This is my first posting to this group, so I am not familiar
> with any special etiquette for it, please bear with me. . .
>
> I maintain the PHP code for the website for the murals of Winnipeg and
> have found a situation where I have a session open with the state of
> the user's search results saved in the session and link to a location
> with the following link:
>
> <A target="blank"
>
href="http://www.themuralsofwinnipeg.com/Mpages/index.php?action=gotomural&m
> uralid=179">
>
> so this opens a new browser window, but it is inheriting the session
values
> from the browser window that called it and is causing problems in the new
> window. When I open a new browser window shouldn't it start a whole new
> session and not get anything from the previous browser.
You can solve this problem by not working with cookies and instead
forwarding the sessionID with the URL:
<A target="blank"
href="http://www.themuralsofwinnipeg.com/Mpages/index.php?<?=
SID;
?>&action=gotomural&muralid=179">
So if you open a new page WITHOUT forwarding the sessionID a new session
will be started.
See the part named "Passing the Session ID" on the following manual page to
see how to do it:
http://de2.php.net/session
Regards,
Torsten Roehr
>
> Thanks in advance for your help,
>
> Bob Bruce,
> Winnipeg, Manitoba
> Canada