'fork' a session

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am working on a webbased application (not a website) and from a page
a new instance of the browser is started (using javascript) offering a
different set of functionalities. What I want is that each new
instance of the browser continues with its own set of
sessionvariables, as two different sessions. Is that possible?

I use the following javascript function:


I use session_start() at the beginning of every page, i also
considered using session_regenerate_id in various ways but this didn't
have the desired effect.

Is there anyone who knows a solution to this problem?


Re: 'fork' a session


Quoted text here. Click to load it

You would have to write your own session management routines inorder to
do this.  I am really not sure as to why you would want to do something
like this however I wish you the best of luck.


Re: 'fork' a session

Lolo wrote:

Quoted text here. Click to load it

If you are storing your session id in a cookie, then there can only be one
session per cookie store (if you run two different browsers, say Opera and
Firefox, each will have a seperate session). I am not aware of any way of
differentiating between browser windows (and I have looked).


1) Don't store the session id in a cookie - use the rewriting mechanism (not
the most reliable if you're doing a lot of javascript)

2) Treat $_SESSION as an array of session variables, and pass a unique index
through each web page e.g.

(this is the solution I used in PfP Studio)



Re: 'fork' a session

Colin McKinnon wrote:
Quoted text here. Click to load it
be one
Opera and
way of

   FWIW, IIRC, someone here pointed out sometimes ago that
session_name() can be used to switch across (different) sessions.

  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com    Blog: http://rajeshanbiah.blogspot.com /

Site Timeline