Re: Two session for the same user, possible?
| From: | Micah Stevens | Date: | Thu, 21 Oct 2004 21:03:02 +0000 |
| Subject: | Re: Two session for the same user, possible? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36957@lists.php.net to get a copy of this message | ||
The Session ID is the same, so it will access the same variables. If you want
to force a new session in the new script, do this:
http://us2.php.net/manual/en/function.session-regenerate-id.php
But this will in effect log the user out of the first session as well. If you
want to be able to do both, I suggest you use different names for your
session vars.
-Micah
On Thursday 21 October 2004 12:39 pm, Andre Matos wrote:
> Hi Matt,
>
> I have developed two different web systems that use php sessions. When I a
> user log into one system, the system creates a session and storage on it
> one object called UserSession with some information that I need while the
> user works with the system.
>
> My problem is when the user decides to open the second system without log
> out from the first one that he logged, using a new window (crtl+N) from the
> same browser. This second system creates also an object called UserSession,
> but with different properties and this new object from the second system
> overwrites the object from the first system. This is my problem. Can I make
> PHP understand that this is a complete different session?
>
> Thanks.
>
> Andre
>
> --
> Andre Matos
> andre.matos@sympatico.ca
>
> -----Original Message-----
> From: Matt M. [mailto:h.dudeness@gmail.com]
> Sent: Thursday, October 21, 2004 3:23 PM
> To: Andre Matos
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] Two session for the same user, possible?
>
> > Is it possible to have two sessions for the same user in php? If yes, how
> > can I implement this?
> >
> > I am currently using one without problem. However, when I try to create a
> > second session, the first one is lost.
>
> could you post some code. I am not sure I follow what you are doing.