Solved

Logout, redirection and history cleanup

Posted on 2007-11-20
3
825 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
  • 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 500 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

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
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.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

830 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