Re: Session_OnEnd doesn't get called when shutting down a browser
From: Bob Lehmann (nospam_at_dontbotherme.zzz)
Date: 08/13/04
- Next message: Tarwn: "RE: error checking doesn't appear to be working"
- Previous message: norton: "Problem in using Request and Request.Form"
- In reply to: Dan Nash: "Re: Session_OnEnd doesn't get called when shutting down a browser"
- Next in thread: Nancy Drew: "Re: Session_OnEnd doesn't get called when shutting down a browser"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Aug 2004 06:57:22 -0600
How would you use JavaScript to disable browser closing?
Bob Lehmann
"Dan Nash" <dan@musoswire.co.uk> wrote in message
news:63386C04-4411-40C8-91EC-3AA5CC8DC9E8@microsoft.com...
> Hi again,
>
> Just a couple of thoughts...
>
> As you are developing a membership based system, have you thought about
> using JS to disable browser closing, and actually forcing them to Logout
> using a link on your page?
>
> Also, as Aaron has been saying, the session will time out anyway after 20
> minutes. Presumably, to prevent people sharing memberships, when someone
logs
> in you could presumably delete their current (login) - so the new instance
of
> login is active, and the old one is inactive, locking out anyone else?
>
> Hope that makes sense? :o)
>
> Cheers
>
>
> Dan
>
> "Nancy Drew" wrote:
>
> > i think what aaron was getting at was the stateless nature of http. the
> > client attemts to login, i write a special cookie to their browser,
giving
> > the cookie a unique name and packing it into the application array. then
in
> > 5 minutes, i want to check if the client is still active, so i request
that
> > specially named cookie. sounds great, until you account for the nature
of
> > http. the client opens a socket to a server, doing a request or post,
the
> > server attempts to find the resource the client is after, sends the
> > appropriate response back to the client, and closes the socket again. a
> > cookie can only be fetched when the client makes a request - i can't
tell
> > the server to go out and establish a new connection to the client.
> >
> > i guess i should have known better, but i've been on this and a few
other
> > problems for a few too many hours now and am getting a little dingy.
> >
> > "Dan Nash" <dan@musoswire.co.uk> wrote in message
> > news:89C81B3B-9E22-4DD7-A61C-B46AFF438F6A@microsoft.com...
> > > hiya
> > >
> > > could you not do the probing, and then update the application array
> > > accordingly?
> > >
> > > Aaron's Ip solution might be the way to go though.
> > >
> > > "Nancy Drew" wrote:
> > >
> > > > yeah - i was thinking about just that - a server side probe. maybe i
can
> > > > write a cookie to client, request it every 5 minutes or so, and
remove
> > the
> > > > userID from the application array if i don't get a response...
> > > >
> > > > setting a shorter timeout on the session object won't help - the
> > application
> > > > array persists beyond the session object, so the userID is still in
> > there
> > > > (meaning the user won't be able to login the next time).
> > > >
> > > >
> > > >
> > > > "Dan Nash" <dan@musoswire.co.uk> wrote in message
> > > > news:8B009D34-E800-4974-8CB7-C829DE0BF124@microsoft.com...
> > > > > hey
> > > > >
> > > > > yeah the popup blockers would be a problem. when i used this it
was on
> > an
> > > > > internal intranet, so that wasnt an issue.
> > > > >
> > > > > server-side. there must be a way of "probing" the session, say
every 5
> > > > > minutes, if u get a response, leave them alone, if u dont, log
them
> > out.
> > > > not
> > > > > sure how you would do that. the session will end on timeout
anyway -
> > > > perhaps
> > > > > just give your sessions a really samll timeout value in
global.asa?
> > > > >
> > > > > HTH
> > > > >
> > > > >
> > > > > Dan
> > > > >
> > > > >
> > > > > "Nancy Drew" wrote:
> > > > >
> > > > > > hey dan
> > > > > >
> > > > > > excellent idea. one problem may be that the user has a pop-up
> > blocker,
> > > > or no
> > > > > > client side scripting. i'm hoping for a server side solution if
> > > > possible?
> > > > > >
> > > > > > may still go this route, though.
> > > > > >
> > > > > > tks
> > > > > >
> > > > > >
> > > > > > "Dan Nash" <dan@musoswire.co.uk> wrote in message
> > > > > > news:C45460C4-F94F-4327-9F13-3B88F162B8CD@microsoft.com...
> > > > > > > Hi,
> > > > > > >
> > > > > > > You could try calling a javascript funtion from your <body
> > > > onunload="">
> > > > > > > event to open a new asp page in a window, and use that new asp
> > page to
> > > > > > logout
> > > > > > > the user?
> > > > > > >
> > > > > > > HTH
> > > > > > >
> > > > > > >
> > > > > > > Dan
> > > > > > >
> > > > > > > "Nancy Drew" wrote:
> > > > > > >
> > > > > > > > hi all
> > > > > > > >
> > > > > > > > i'm trying to keep users from being able to login to a site
> > twice at
> > > > the
> > > > > > > > same time. everytime a user does a login, i stick their
userID
> > into
> > > > an
> > > > > > > > application scoped array. if they try to login again, i
bounce
> > them
> > > > to
> > > > > > an
> > > > > > > > error page. i use the session_onEnd sub within global.asa to
> > remove
> > > > > > their
> > > > > > > > userID from the array at the end of their session, and this
> > seems to
> > > > > > work
> > > > > > > > fine. however, if i just shut down the browser, the
sub_onEnd
> > > > doesn't
> > > > > > seem
> > > > > > > > to get called, so i'm unable to remove their userID from the
> > > > application
> > > > > > > > array. any ideas on how to force this sub to fire, or is
there
> > > > another
> > > > > > way
> > > > > > > > around this?
> > > > > > > >
> > > > > > > > tks
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >
- Next message: Tarwn: "RE: error checking doesn't appear to be working"
- Previous message: norton: "Problem in using Request and Request.Form"
- In reply to: Dan Nash: "Re: Session_OnEnd doesn't get called when shutting down a browser"
- Next in thread: Nancy Drew: "Re: Session_OnEnd doesn't get called when shutting down a browser"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|