By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,166 Members | 1,130 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,166 IT Pros & Developers. It's quick & easy.

Managing two sessions in different browsers at one time

P: n/a
Hi,

I need to be able to open another browser from within an already opened
browser with a completely new session (using the same session
variables). How can I do this? In essence, I want to allow a (super)
user to be logged in as another user but without closing his/her own
original session. I've tried everything but the new browser overwrites
the old session variables. I even tried 'regenerating' a new session ID
but the new ID replaces the old one! How can I have a new ID which does
not replace the old one? Is there a clean way to do this? Thanks!
Steve

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Steve <nospam@nopes> wrote:
Is there a clean way to do this? Thanks!


This isn't a PHP issue but a clientside problem...

Btw easiest workaround: use multiple browsers.

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
"Steve" wrote
I need to be able to open another browser from within an already opened
browser with a completely new session (using the same session
variables).
First of all: note that different browsers behave differently. If I remember
correctly: Internet Explorer keeps the session cookies when opening a new
window (including when hitting Ctrl-N from an existing browser window), but
Netscape Navigator did not (though might do nowadays). However, starting a
new browser (it looks the same...) using the Start menu, neither IE nor NN
would share the session cookies with any other open window.

So, assuming the above is still valid: maybe it's good enough to instruct
the super user to open a new browser window using the Start menu...?
How can I have a new ID which does
not replace the old one? Is there a clean way to do this?


You are not forced to use the built-in PHP session mechanism. If you figger
out your own session id (like stored in a cookie with a different name, or
soley based on URL parameters, making it independent of any shared cookies)
then I guess you can explicitely set it using http://php.net/session_id --
and from that point on keep using the built-in PHP session functionality
without destroying the other session. Maybe even http://php.net/session_name
can do the trick without the need for your own session id; I guess PHP would
not destroy the existing session cookie when changing the name.

Note that you should use both functions prior to calling
http://php.net/session_start and that session.auto_start should be turned
off. Full details at http://php.net/session

Keep us posted if you find a solution,
Adriaan.
Jul 17 '05 #3

P: n/a
Steve <nospam@nopes> wrote in message news:<40********@clarion.carno.net.au>...
Hi,

I need to be able to open another browser from within an already opened
browser with a completely new session

<snip>

Look at the previous discussions
<http://groups.google.com/groups?threadm=abc4d8b8.0312182209.33a4dfd0%40post ing.google.com>
and see if it helps you.

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #4

P: n/a
Steve <nospam@nopes> wrote in message news:<40********@clarion.carno.net.au>...
Hi,

I need to be able to open another browser from within an already opened
browser with a completely new session (using the same session
variables). How can I do this? In essence, I want to allow a (super)
user to be logged in as another user but without closing his/her own
original session. I've tried everything but the new browser overwrites
the old session variables. I even tried 'regenerating' a new session ID
but the new ID replaces the old one! How can I have a new ID which does
not replace the old one? Is there a clean way to do this? Thanks!


Certainly you cannot use cookies...so
session.use_cookies = 0
and so,
session.use_trans_sid = 1

Now, try to fool the PHP so that it won't add the trans id in url.
This should generate a new session for that url.

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.