Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Logout, redirection and history cleanup

Posted on 2007-11-20
3
Medium Priority
?
836 Views
Last Modified: 2008-02-01
Hello experts,

I have a small ASP.NET 2 (VB) website with authentication. After x minutes of inactivity, I would like the logged user to be automatically logged out and redirected to wherever.com. It would be also great to cleanup the browser's history (at least my website's entry) and any cookies or other traces of my site (btw, the site is nothing illegal or ethically grey... just sensitive information). How can I accomplish that?

Thanks!
J
0
Comment
Question by:jiiins2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Expert Comment

by:ullfindsmit
ID: 20319571
to logout the user simply use the setTimeOut function on the javasacript. This way the page will automatically redirect to the logout page and clear session / cookies

For clearing the history check out this post
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21289083.html

you might also want to try using an IFrame as that will help avoid url on some browsers to come up.
0
 

Author Comment

by:jiiins2
ID: 20469963
Can you please explain how to use the setTimeOut function? What is the difference with session.timeout?

Thanks,
J
0
 
LVL 12

Accepted Solution

by:
ullfindsmit earned 2000 total points
ID: 20471331
setTimeout is a Javascript function where as Session.Timeout is a Server side function.

setTimeout( "..... javascript code....", [execute after time]);
ex: setTimeout(" alert(' hello' ) ", 5000);
will show an alert after 5 seconds from when the code is executed.

The Session.Timeout will clear all the values in teh session on the server after a certain amount of time that you specify.
ex: Session("UserId") = rs("UserId")
Where rs is your recordset then
Response.Write( Session("UserId") )
will give you the value of the user ID
but if you execute the same response.write code after the duration of the timeout, the value would be an empty string Session("UserId") would be ""

-Smit.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Bada platform is becoming more and more famous this days and people talking about same. Some friends included those who have bada OS mobile asked me "what is bada?"and "what its features?". That encouraged me to research and write this article. [st…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Suggested Courses

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question