After specified browser activity

  • Thread starter Thread starter Robert Baker
  • Start date Start date
R

Robert Baker

Hello, All!

I am seeking the correct technique so that after a specified interval of
inactivity the site's users are automatically directed to a login page.
Note we are not using integrated security, just a SQL lookup when they log
in the 1st time.

Thanks,

Robert Baker
 
unless you put in a clientside timer there's not much you can do.
Now, what I would sugest isnt' timing it, but rather after (n) time, have
the NEXT CLICK redirect to a login page. This is build in the web.config
(see auth section)
 
You can use Meta Refresh to handle this. When the page loads a "timer"
starts counting seconds. When it reaches zero, it will send them to
whatever page you tell it. Note: It does NOT care about activity. It only
cares about time. If you find something that is bound to "activity", let me
know.


This code wil redirect the user to logoff.asp after 20 minutes.

<html>
<head>
<title>My Tital</title>
<META HTTP-EQUIV="REFRESH" CONTENT="1200; URL=logoff.asp">
</head>
<body>


Michael
 
Thanks a lot for Curt and Michael's suggestions.

Hi Robert,

Thanks for posting in the community!
From your description, you'd like to implement a custom mechanism which
used to detect whether the user has been inactive for a certain period of
time on a web app. If so, automatically redirect them to a certain login
page, yes?

As for this problem, here are my suggestions:
1. As Curt has metioned, if you need to determine whether the user should
be timeout according on the recorded time at serverside(in memory or
database). Then, you can only redirect user after the user's NEXT CLICK.

2. If you want to automaticlly reidirect user to a page, you need to use
javascript(such as window.location.href =...) or the meta tag as Michael
has mentioned. However, since the timeout state info are on serverside, I
think you need to do constant post to the serverside to check whether the
user is timeout, do you think so? But constantly posted back will make the
page looked so uncomfortable to user. I think you may use a iframe page
embeded in your web page. The iframe inner page will contantly be posted
back( you can use the meta tag Michael provided) and check the state(time
flag) in the database. And in the main page, you can use the
"window.setInterval" function to check a hidden field flag to determine
whether to redirect the user or not. How do you think of this?

Please check out the suggestions. IF you have any other ideas, please feel
free to let use know.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Hi Robert,

Have you got any ideas on this problem? As for the "NEXT CLICK" mentioned
in my last reply's #1, it means that the customer will ber redirect only
after he post another request(submit the page or ..) to the serverside.
Becaue if you put the state info on serverside and timing out check it also
at server, it need the client user to post back and redirect the request.
Please check out them and if you have any other ideas, please also feel
free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top