Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Logout, redirection and history cleanup

Posted on 2007-11-20
3
Medium Priority
?
845 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
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.
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…

824 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