Solved

Logout, redirection and history cleanup

Posted on 2007-11-20
3
833 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 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

635 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