Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

response.redirect when session expires 1

Status
Not open for further replies.

kiwieur

Technical User
Apr 25, 2006
200
GB
Hi i am using a frameset with 3 frames

TopFrame
LeftFrame
MainFrame

when users login in I validate there username and store it in a session variable, then at the top of every page I have the following

Code:
<%
If Session("Username") = "" Then
  Response.Redirect "../Empty.asp"
End If
%>

Then in empty.asp i redirect them back to the login page using the following

Code:
<% response.Redirect("Login.asp") %>

however depending which frame they try to use after session expires is where the login page tries to open.

i.e. if they click in the leftframe this is where the login page appears.

my question is how can i redirect to the parent for the login page ??

any help would be appreciated



Regards

Paul

 
Try this. In your "Empty.asp" try placing the following javascript in the <head></head> section of the page.

<script language="JavaScript">
function logoutProcess()
{
if (confirm("To complete the log out process, you must close this browser window. Click ok to complete" + " logout."))
{
parent.window.top.close();
parent.window.top.location="login.asp";
}
}
</script>

and in the body tag add : <body onload="logoutProcess()">

This is what I use on the asp pages I have that open in frames. Hope this helps.
 
bhuninghake,

Thank you very much for your help, i used your code and it works great.

A "star" for you

Regards

Paul

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top