views:

22

answers:

1

I have a silverlight app where the users what a logout timer.

So I use a timer and then after 10 mins i call

HtmlPage.Window.Navigate(new Uri(loginPageUrl));

But the user can still just use the Back Arrow to return to the silverlight app.

Is there any way to prevent that?

I have added some code to the asp page, as below, but that does not seem to help.

Response.Expires = -1;
Response.AddHeader("Pragma", "No-Cache");        
Response.CacheControl = "no-cache";

Any idea's or other suggestions?

A: 

A simple solution in keeping with your current approach would be to have your timer run every 5 seconds and then do something like this:

if(IsSessionExpired)
{
   HtmlPage.Window.Navigate(new Uri(loginPageUrl));
}

This will redirect them within 5 seconds of them hitting the back button...

Scrappydog