473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Managing two sessions in different browsers at one time

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
4 3092
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
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location...
9
by: E. Will | last post by:
Hello world, Myself and a few friends have been experiencing the same problem. When using sessions in PHP for ``logins'' we experience the sessions ``mixing.'' To say, one user logs in as...
22
by: Theo | last post by:
Question for the group The authentication system for the site Im working on seems to function properly and all is good. A session keeps track of everything and a cookie is used to accept or deny...
3
by: Colin McKinnon | last post by:
Hi all, The title says it all - I'm doing sessions with cookies. I can divide the data within the session easily enough but I can't see when the user creates a new window or closes an old one. ...
10
by: Mark H | last post by:
Hey all-- I'm building a database and I basically need to keep out people who aren't authorized, but it's not like I need top security here. I'm just doing basic user/pass of a SQL database, and...
9
by: strycat | last post by:
Hello, I've got two different sets of ASP scripts on my server. Each set is kept in their own directory. Both sets of scripts use sessions. I want to make sure that the sessions are not...
2
by: Chris Mahoney | last post by:
Hi I'm using several Sessions in my app. When the user has cookies enabled in their browser, everything works fine. But with cookies disabled, only IE seems to remember the sessions. In Firefox...
2
by: Slav | last post by:
Hello, I am using multiple instances of IE on the same machine to test a web site I've created. The web site can be accessed by multiple user type each with different access rights (e.g. Admin...
8
by: Chuck Anderson | last post by:
I've instituted a sessions based scheme on my web site to combat hot linking to my images. When someone requests a page at my site, I set a session variable. I then use htaccess to redirect *all*...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.