Solved

Logout, redirection and history cleanup

Posted on 2007-11-20
3
816 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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 +…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now