Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to automatically show user he's been logged out

Reply
Thread Tools

how to automatically show user he's been logged out

 
 
Keith G Hicks
Guest
Posts: n/a
 
      03-08-2008
asp.net 2.0

I have set my web.config as follows: <forms timeout="30"/> (I know that's
the default but I may chang it so the line's in there)

I also have a few cookies I'm setting on my login page to hold the UserName,
UserID and the value of another field in my db so that as the user is
navigating around the site I can test for certain things. All that seems to
be fine. I've set the cookies to expire in 30 minutes also to coordinate
wiht the login stuff in asp.net 2.

I tested all this by setting the above times to 1 minute. If I log in and go
to a page that requires login and then don't do anythign for one minute and
then try to do something that requires me to be logged in, the login page
appears again and all's good.

The problem is that I have my login link and my LoginName control on my
master page and so even after the timeout has occurred, those still indicate
the user is logged in. They don't change to the logged out state until after
I try to do some action. I'd like to update these automatically and put a
message up that says the user has been logged out when that happens. I've
been to many websites where this is done. My bank's site for example does
this. After 10 minutes of inactivity, I'm logged out and the page is updated
to reflect the fact that I'm no longer logged in. I'm presented with the
login text boxes again. How can I do this same thing? How can I
automatically update the page to show that after the timeout the user has to
log in again. Otherwise, even though the user is actually no longer
authenticated, the page seems to indicate that he's still logged in.

Thanks,

Keith


 
Reply With Quote
 
 
 
 
Keith G Hicks
Guest
Posts: n/a
 
      03-10-2008
Anyone? Bueller? Anyone?


"Keith G Hicks" <(E-Mail Removed)> wrote in message
news:O6#$(E-Mail Removed)...
> asp.net 2.0
>
> I have set my web.config as follows: <forms timeout="30"/> (I know that's
> the default but I may chang it so the line's in there)
>
> I also have a few cookies I'm setting on my login page to hold the

UserName,
> UserID and the value of another field in my db so that as the user is
> navigating around the site I can test for certain things. All that seems

to
> be fine. I've set the cookies to expire in 30 minutes also to coordinate
> wiht the login stuff in asp.net 2.
>
> I tested all this by setting the above times to 1 minute. If I log in and

go
> to a page that requires login and then don't do anythign for one minute

and
> then try to do something that requires me to be logged in, the login page
> appears again and all's good.
>
> The problem is that I have my login link and my LoginName control on my
> master page and so even after the timeout has occurred, those still

indicate
> the user is logged in. They don't change to the logged out state until

after
> I try to do some action. I'd like to update these automatically and put a
> message up that says the user has been logged out when that happens. I've
> been to many websites where this is done. My bank's site for example does
> this. After 10 minutes of inactivity, I'm logged out and the page is

updated
> to reflect the fact that I'm no longer logged in. I'm presented with the
> login text boxes again. How can I do this same thing? How can I
> automatically update the page to show that after the timeout the user has

to
> log in again. Otherwise, even though the user is actually no longer
> authenticated, the page seems to indicate that he's still logged in.
>
> Thanks,
>
> Keith
>
>



 
Reply With Quote
 
 
 
 
Larry Bud
Guest
Posts: n/a
 
      03-10-2008
On Mar 10, 11:19*am, "Keith G Hicks" <(E-Mail Removed)> wrote:
> Anyone? Bueller? Anyone?
>
> "Keith G Hicks" <(E-Mail Removed)> wrote in messagenews:O6#$(E-Mail Removed). ..
>
>
>
> > asp.net 2.0

>
> > I have set my web.config as follows: <forms timeout="30"/> (I know that's
> > the default but I may chang it so the line's in there)

>
> > I also have a few cookies I'm setting on my login page to hold the

> UserName,
> > UserID and the value of another field in my db so that as the user is
> > navigating around the site I can test for certain things. All that seems

> to
> > be fine. I've set the cookies to expire in 30 minutes also to coordinate
> > wiht the login stuff in asp.net 2.

>
> > I tested all this by setting the above times to 1 minute. If I log in and

> go
> > to a page that requires login and then don't do anythign for one minute

> and
> > then try to do something that requires me to be logged in, the login page
> > appears again and all's good.

>
> > The problem is that I have my login link and my LoginName control on my
> > master page and so even after the timeout has occurred, those still

> indicate
> > the user is logged in. They don't change to the logged out state until

> after
> > I try to do some action. I'd like to update these automatically and put a
> > message up that says the user has been logged out when that happens. I've
> > been to many websites where this is done. My bank's site for example does
> > this. After 10 minutes of inactivity, I'm logged out and the page is

> updated
> > to reflect the fact that I'm no longer logged in. I'm presented with the
> > login text boxes again. How can I do this same thing? How can I
> > automatically update the page to show that after the timeout the user has

> to
> > log in again. Otherwise, even though the user is actually no longer
> > authenticated, the page seems to indicate that he's still logged in.


It has to be handled with a timer on the clint via Javascript. That
timer has to be set to the same as the session timeout. Once the
timer runs out, forward to another page (or display a hidden <DIV>
that tells the user he's logged out).
 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
automatically being logged off after eery action claudiaorr4 General Computer Support 0 04-18-2007 02:48 AM
Serious issue: parts of my page render as not logged in, parts as logged in. Help! pcloches@gmail.com ASP .Net 1 04-12-2007 12:50 AM
Any way i can show tree view item by logged in user role? Jens Jensen ASP .Net 0 01-04-2007 01:44 PM
LoginView does not show a logged in user as being logged in keithb ASP .Net 0 02-16-2006 05:20 PM



Advertisments