Managing two sessions in different browsers at one time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    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

  • Daniel Tryba

    #2
    Re: Managing two sessions in different browsers at one time

    Steve <nospam@nopes > wrote:[color=blue]
    > Is there a clean way to do this? Thanks![/color]

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

    Btw easiest workaround: use multiple browsers.

    --

    Daniel Tryba

    Comment

    • Adriaan

      #3
      Re: Managing two sessions in different browsers at one time

      "Steve" wrote[color=blue]
      > 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).[/color]

      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...?
      [color=blue]
      > How can I have a new ID which does
      > not replace the old one? Is there a clean way to do this?[/color]

      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_st art should be turned
      off. Full details at http://php.net/session

      Keep us posted if you find a solution,
      Adriaan.


      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: Managing two sessions in different browsers at one time

        Steve <nospam@nopes > wrote in message news:<40984892$ 1@clarion.carno .net.au>...[color=blue]
        > Hi,
        >
        > I need to be able to open another browser from within an already opened
        > browser with a completely new session[/color]
        <snip>

        Look at the previous discussions
        <http://groups.google.c om/groups?threadm= abc4d8b8.031218 2209.33a4dfd0%4 0posting.google .com>
        and see if it helps you.

        --
        | Just another PHP saint |
        Email: rrjanbiah-at-Y!com

        Comment

        • R. Rajesh Jeba Anbiah

          #5
          Re: Managing two sessions in different browsers at one time

          Steve <nospam@nopes > wrote in message news:<40984892$ 1@clarion.carno .net.au>...[color=blue]
          > 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![/color]

          Certainly you cannot use cookies...so
          session.use_coo kies = 0
          and so,
          session.use_tra ns_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

          Comment

          Working...