Re: weird behaviour with sessions
| From: | Ernest E Vogelsinger | Date: | Sat, 17 May 2003 18:54:58 +0000 |
| Subject: | Re: weird behaviour with sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148038@lists.php.net to get a copy of this message | ||
At 19:09 17.05.2003, harald said:
--------------------[snip]--------------------
>Hi.
>
>I'm experiencing strange behaviour with my sessions:
>on page A there is a logon form (UID/PWD) with target of the submit being
>'_blank'. So when I submit, a new window B opens, I do session_start(),
>check the credentials and on success relocate to the main application while
>passing on the session ID. The application has all sorts of links in a
>navigation bar, all of which now have the session ID appended. The
>'logout'-link points to a script which destroys the session and closes the
>window (B).
>
>Now (please bear with me), when I switch back to the logon form in window A
>(still open) and just submit again, the process starts over BUT WITH THE
>SAME session ID. How can this be ??
--------------------[snip]--------------------
Most probably you are issuing session_start() within your login page. So
PHP has already its session ID, and it continues using it. I mean something
like:
<?php
session_start();
?>
<form action="somepage.php" target="_blank">
-- login form detais
</form>
In this scenario remove session_start() as the session ID will be
constructed once (upon opening of your login page) and reused.
HTH,
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/