Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: New Session for new Window (or: Session ID vs. Process ID...)

by JayBonci (Curate)
on Feb 26, 2003 at 07:14 UTC ( [id://238681]=note: print w/replies, xml ) Need Help??


in reply to New Session for new Window (or: Session ID vs. Process ID...)

ASP session objects work on cookies. Because you are opening a new window in the same browser thread, it shares the cookies that are local to that thread. If you "Open In New Window...", it spawns a new local thread with the same base cookie file, but you should be able to login and do other things from there. You'll find whichever browser window that you close last will write to your global cookie file.

Session Objects are somewhat flawed, and you can never gaurentee that Abandon() will ever be called on a Session or Application object. It may be in your best interest to manually manage the cookies. I've never found an ASP application where the problems in the Session object were outweighed by it's convenience.

    --jaybonci
  • Comment on Re: New Session for new Window (or: Session ID vs. Process ID...)

Replies are listed 'Best First'.
Re: Re: New Session for new Window (or: Session ID vs. Process ID...)
by shushu (Scribe) on Feb 26, 2003 at 07:51 UTC
    Thanks for the response.
    It is clear to me that I actually work with cookies, and that I need to "manage the cookies", but what that I want is not to create new cookie, but instead work with the document cookie and just (it seems for me that this is really a "just" - a simple task) create what you called cookies local to the thread to be local to the window.
    Can I do this at all ?

    Thanks,
    shushu
      Instead of using the $Session object, use $Response->Cookie() and give it a value. What are you using the $Session object for depends on what you'd store in the ->Cookie (specific to your particular ASP application). This way, you can be gaurenteed that Session->Abandon() won't change your Session ID.

      How are you authenticating the users? A database of some sort?

          --jaybonci
        My application is a strange one. I do not use the Session to authenticate anything, and I don't have any permission handling, since I don't need it.

        You wrote that by handling the $Response->Cookie I can force the $Session->Abandon to do nothing (by setting the cookie's Session ID key to the value I want - great).
        But - I want the opposite - I want to create a different Sessions per window.
        Before trying (which I will just going to do) I am almost certain that forcing a new Session ID in the Response->Cookie won't create a new cookie per window, and that I will still be with a Session per process.

        What do you think ?
        shushu

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://238681]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found