[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

Session Timeout

Hi,

My current application includes a login page, which deciphers the current user/security privileges etc.

Once this is determined I am populating session variables - which are used within subsequent sql queries / pages etc.

I am hoping to capture the session timing out so that I can the redirect the user back to the initial login page, so that the variables can be reset correctly (I don't want to use application variables).

This works fine, however, if the user happens to be within a frame when the session timesout, then the 'response.redirect' method brings the login page within the current frame.

Is there any way that I can break out of any frames they may happen to be in, so that the login page always shows up as being 'maximised'?

Andy
0
amtate
Asked:
amtate
1 Solution
 
robbertCommented:
amtate,
in ASP, there is no method for windows, or frames.

In loginpage.asp, you can place;

<script language=javascript>
  if (self.location.href != top.location.href) {
    top.location.href = self.location.href
  }
</script>
0
 
cable4096Commented:
Put the response.redirect in the first HTML that loads the frame.

Target="_top" usually puts the page at the top on the client side. If you can somehow put that into the redirect, it might work.

You might also want to try meta tags

<meta http-equiv="refresh" content="1; URL=expired.asp">

But I am not sure how to put a target into there, unless:

<meta http-equiv="refresh" content="1; URL=expired.asp target=_top">

Works?

0
 
md_harrisCommented:
You could put the user redirection in the global.asa file in the Session_OnEnd block. Then put one of the previous javascripts on the login page to get out of any frames.


In global.asa:
---------------------
Session_OnEnd
  Response.Redirect("http://www.whatever.com/login.asp")
End Sub

0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now