Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > keeping session alive after browser closed, possible?

Reply
Thread Tools

keeping session alive after browser closed, possible?

 
 
soni2926@yahoo.com
Guest
Posts: n/a
 
      09-18-2008
hi,
i'm working on a site, which has a session created after a user
logins, each page checks to make sure the session is there onload
otherwise redirects to the login page. now the clients are asking us
to make a remember me feature, is there any way to do this with the
existing session set up? or do i need to rework it, as remember me
from what i was planning was going to drop a cookie, so do i need
change all those session checks to cookie checks or anyway to have
remember me work with sessions instead? as they want it so if they
close the pc for the night or just the browser and come back later or
the next day login should not be required if they directly hit the
homepage.

Thanks.
 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      09-19-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) formulated on donderdag :
> hi,
> i'm working on a site, which has a session created after a user
> logins, each page checks to make sure the session is there onload
> otherwise redirects to the login page. now the clients are asking us
> to make a remember me feature, is there any way to do this with the
> existing session set up? or do i need to rework it, as remember me
> from what i was planning was going to drop a cookie, so do i need
> change all those session checks to cookie checks or anyway to have
> remember me work with sessions instead? as they want it so if they
> close the pc for the night or just the browser and come back later or
> the next day login should not be required if they directly hit the
> homepage.
>
> Thanks.


The session itself doesn't close immediately when the browser is closed
(the server doesn't know that that browser closed). But as the browser
closes, it forgets it's session-cookie, so it can't go "back" to that
session.

What you will need to do is have a permanent cookie (that is: with
expiry date) stored on the client. When a "guest user" (that is: not
logged in) hits your homepage, check that cookie. If it contains a
valid "token" (you can decide what that is), then log that identified
user in automatically.

If the user explicitly logs out, remove that cookie by overwriting it
with an empty one.

Hans Kesting


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How keep python socket alive for ever by setting Keep alive flag. hisan Python 1 06-25-2012 05:30 PM
Keeping a session alive when accessing an ASP page with .Net code =?Utf-8?B?RGF2ZSBBbHZhcmFkbw==?= ASP .Net 0 09-01-2005 02:09 PM
Keeping session alive using jakarta httpclient Michael Fortin Java 1 10-12-2004 02:13 PM
Keeping a Session alive during long downloads hoenes1 ASP .Net 0 08-16-2004 12:02 PM
Keeping alive ISDN 128k to ISP Mr Sanghez Cisco 2 07-06-2003 06:17 PM



Advertisments