• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1086
  • Last Modified:

logout

In the 1st page (default.asp), i put:

<%
session("userid")= 2
%>



For the rest of the pages, at the top i put:

<%
if isempty (session("userID")) then
  response.redirect "./default.asp"
end if
%>



and a "logout" link to redirect to logout.asp  that contain:

<%
Session.Abandon
Response.Redirect("./")
%>



the first time i open Internet explorer, i can't go to other pages except the "default.asp" page.
After i login, and proceed to other page, then i click the "logout" link, which will bring me to "default.asp" page.
From that time onwards, i can access to other pages without loggin in.

So how can i prohibit the access to other pages before logging in again after clicking the logout link?

I don't have any global.asa file, cause i don't know when i will use it.
0
Johannes1979
Asked:
Johannes1979
  • 20
  • 18
  • 2
  • +5
1 Solution
 
jitgangulyCommented:
Logically you should not be able to go to other pages once you issue a session.abandon.

Just modify this code to check teh length

<%
if isempty(session("userID")) or len(session("userID")) = 0 then
 response.redirect "./default.asp"
end if
%>

Also in logout page

<%
session("userID")=""
Session.Abandon
Response.Redirect("./")
%>






0
 
ckanetaCommented:
In the 1st page (default.asp), i put:
<%
session("userid")= 2
%>

and a "logout" link to redirect to logout.asp  that contain:
<%
Session.Abandon
Response.Redirect("./")
%>

looks to me like you're calling session.abandon, then redirecting to the default page which sets the session variable you're checking for so all of the
if isempty(session("userID")) or len(session("userID")) = 0 then
response.redirect "./default.asp"
end if
checks would return FALSE because session("userID") is not empty

so try redirecting to some other page instead of default.asp, or just don't redirect at all and try to access another of your pages...
0
 
Johannes1979Author Commented:
still the same...thought i have change the code that you recommend to me.

Is it about the application that i created in ISM wrongly??
0
Technology Partners: 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!

 
jitgangulyCommented:
Whats your latest code ? Have you included len function with isempty ? Are you setting session("userid) to zero or zero length string like

<%
session("userID")=0
Session.Abandon
Response.Redirect("./")
%>

Try this. I told you to put a zero lenght string, but try with number 0





0
 
hongjunCommented:
Try this

In the 1st page (default.asp), i put:

<%
session("userid")= 2
%>



For the rest of the pages, at the top i put:

<%
if session("userID") = "" then
 response.redirect "./default.asp"
end if
%>



and a "logout" link to redirect to logout.asp  that contain:

<%
Session.Abandon
Session("userid") = ""
Response.Redirect("./")
%>

hongjun
0
 
weesiongCommented:
Johannes1979,

Sorry, i no got your means, izzit you want the user must goto default.asp page, and then just can go in other page, if not they canot access other page?

Regards,
Wee Siong
0
 
Johannes1979Author Commented:
Any code is not working.

Is it related to frame??

since only the first page i include top frame, then the rest of the pages also don't know why got the top frame.

the logout button i put in the top frame.

In the first page (lower frame) is a page where user need to key in username and password, so:
1. how to change the top frame when the user SUCCESSFULLY keyed in the identities??
0
 
weesiongCommented:
Johannes1979,

I really dont go the key what you want :( maybe today weesiong is lazy to thinking :) LOL!

But nevermind, the algorithm like this:

oh... better way send me the all the frame page files to me, i think i can solve in 3min :)

Regards,
Wee Siong
0
 
Johannes1979Author Commented:
This is the default.asp (frameset)

<html>
<head>
<title>frame_index</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="117,*" frameborder="NO" border="0" framespacing="0" cols="*">
  <frame name="topFrame" scrolling="NO" noresize src="title.asp" >
  <frame name="mainFrame" src="defaultpage.asp">
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">

</body></noframes>
</html>



This is the top frame (title.asp).

<html>
<head>
<title>text berpendar</title>
</head>

<body>

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
<a href="logout.asp" target="_parent">Logout</a>


</body>
</html>


This is the lower frame (defaultpage.asp):

<%@ Language=VBScript %>
<%
if NOT isempty(request.form ("Login")) then
  set conn=server.createobject ("adodb.connection")
  conn.open "mydsn", "sayang", "sayang"
  set RSFindUser = conn.Execute("select userID from USER1 where " _
  & "userID = '" & request.form("userid") & "' and " _
  & "password = '" & request.form("password") & "'")
  if RSFindUser.EOF then
     TheMessage = "Invalid UserID or Password."
  else
     Session("userid") = RSFindUser("userID")
       response.redirect "./main.asp"
  end if
end if
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%response.write themessage %>
<table width="1004" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="308" height="37"></td>
    <td width="62"></td>
    <td width="94"></td>
    <td width="21"></td>
    <td width="11"></td>
    <td width="11"></td>
    <td width="193"></td>
    <td width="15"></td>
    <td width="80"></td>
    <td width="2"></td>
    <td width="207"></td>
  </tr>
  <tr>
    <td height="25"></td>
    <td colspan="9" valign="top"><b><font size="4">If you're already a member,
      please log in....</font></b></td>
    <td></td>
  </tr>
  <tr>
    <td height="38"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="1"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td rowspan="3" valign="top">
      <form name="form1" method="post" action="">
        <p>
          <input type="text" name="userid">
        </p>
        <p>
          <input type="password" name="password">
        </p>
        <p>
          <input type="submit" name="Login" value="Login">
        </p>
      </form>
    </td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="157"></td>
    <td></td>
    <td colspan="2" valign="top">
      <p><font size="3" face="Arial, Helvetica, sans-serif">UserID</font></p>
      <p><font size="3" face="Arial, Helvetica, sans-serif">Password</font></p>
    </td>
    <td></td>
    <td valign="top">
      <p>:</p>
      <p>:</p>
    </td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="17"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="21"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="28"></td>
    <td colspan="7" valign="top"><b><font size="4">If you are not yet registered....</font></b></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="25"></td>
    <td></td>
    <td></td>
    <td colspan="6" valign="top"><b><font size="4"><a href="register.asp">Join</a>
      now as a NEW member</font></b></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="211"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
</table>
</body>
</html>



This is where it should go, after succesfully loged in (main.asp):

<%@ Language=VBScript %>
<%
if isempty(session("userID")) or len(session("userID")) = 0 then
response.redirect "./default.asp"
end if
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">

<table width="831" border="0" cellpadding="0" cellspacing="0" mm:layoutgroup="true">
  <tr>
    <td width="166" height="34"></td>
    <td width="99"></td>
    <td width="446"></td>
    <td width="120"></td>
  </tr>
  <tr>
    <td height="70"></td>
    <td colspan="3" valign="top">
      <div align="center"><b><font size="5" face="Geneva, Arial, Helvetica, san-serif">Welcome
        to Computer Network File Sharing System</font></b></div>
    </td>
  </tr>
  <tr>
    <td height="62"></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="10"></td>
    <td rowspan="2" valign="top"><a href="Publish.asp"><img src="pic/bookwrite.gif" width="88" height="75" border="0"></a></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="66"></td>
    <td></td>
    <td rowspan="2" valign="top"><a href="search.asp"><img src="pic/search.gif" width="106" height="76" border="0"></a></td>
  </tr>
  <tr>
    <td height="10"></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="81"></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="70"></td>
    <td valign="top">&nbsp;</td>
    <td></td>
    <td valign="top">&nbsp;</td>
  </tr>
</table>
</body>
</html>

0
 
Johannes1979Author Commented:
The top frame for after successfully log in is:

"title2.asp"
0
 
weesiongCommented:
Johannes1979,

<form name="form1" method="post" action="defaultpage.asp">

Regards,
Wee Siong
0
 
weesiongCommented:
Johannes1979

in defaultpage.asp you are forget to set action form.......

Regards,
Wee Siong
0
 
Johannes1979Author Commented:
wee siong, it still the same.
The title.asp(top frame) file didn't change in the next page.
0
 
Johannes1979Author Commented:
and i still can go to the main.asp after i click logout.
0
 
weesiongCommented:
Johannes1979,

So in first time use goto the default.asp, it got the topframe or not? the topframe for "logout" got it or not, or just defaultpage.asp only?

Regards,
Wee Siong
0
 
ckanetaCommented:
did you try abandoning the session and then loading the page containing the frameset?
0
 
Johannes1979Author Commented:
weesiong: got the top frame in any pages. First time also got top frame.

ckaneta: yes.
0
 
Johannes1979Author Commented:
Seems it is difficut, i increase the points  :P
0
 
puranik_pCommented:
there's some bug with session.abondon.
i've had a bad time with it.
the only solution is..
for logging on..
session("UserName") = UserName
For logging out..
session("UserName") = ""

Then check on each and every page
if session("UserName") = "" Then
    response.redirect "accessdenied.asp"
End If

0
 
weesiongCommented:
Johannes1979,

300 points :)

please try close your browser, and goto main.asp see it will redirect to default page or not.

Regards,
Wee Siong
0
 
weesiongCommented:
Johannes1979,

and try add

<%Response.Expires = 0%>

in each page header

Regards,
Wee Siong
0
 
Johannes1979Author Commented:
please try close your browser, and goto main.asp see it will redirect to default page or not.----->yes, it will redirect to the default page, if i close the browser and open it again.

but it will not goto main.asp, after the user has ever login, and then logout.

This indicates that logout.asp not work properly.
0
 
Johannes1979Author Commented:
I think this is related to the previous post in EE.

http://www.experts-exchange.com/jsp/qShow.jsp?qid=20090891#1
0
 
weesiongCommented:
Johannes1979,

Try login and in your main.asp:

<%
Response.Write(Session("userID"))
Response.End
if isempty(session("userID")) or len(session("userID")) = 0 then
response.redirect "./default.asp"
end if
%>

I want to make sure your Session() can work or not :)

Regards,
Wee Siong
0
 
weesiongCommented:
Johannes1979,

http://www.experts-exchange.com/jsp/qShow.jsp?qid=20090891#1  <---- But you page all are .asp

Regards,
Wee Siong
0
 
weesiongCommented:
Johannes1979,

And try this:
<%
if NOT isempty(request.form ("Login")) then
 set conn=server.createobject ("adodb.connection")
 conn.open "mydsn", "sayang", "sayang"
 set RSFindUser = conn.Execute("select userID from USER1 where " _
 & "userID = '" & request.form("userid") & "' and " _
 & "password = '" & request.form("password") & "'")
 if RSFindUser.EOF then
    TheMessage = "Invalid UserID or Password."
 else
    Session("userid") = RSFindUser("userID")
Response.Write("Passowrd Correct")
      response.redirect "./main.asp"
 end if
end if
%>

I want to make sure when the password is correct it will run ELSE this line or not :)

Regards,
Wee Siong
0
 
Johannes1979Author Commented:
weesiong:
Try login and in your main.asp:

<%
Response.Write(Session("userID"))
Response.End
if isempty(session("userID")) or len(session("userID")) = 0 then
response.redirect "./default.asp"
end if
%>

results is blank...but it's going to the main.asp page.
0
 
Johannes1979Author Commented:
yes, it run that.

Now, the problem is:

the logout button is in title.asp. Everything is redirected to the exact page. but only thing is, the session("userid") is not abandoned.
0
 
Johannes1979Author Commented:
i' ll send to you weesiong by email, for the code. give me 5 minutes :)
0
 
weesiongCommented:
Johannes1979,

Logout.asp

<%
Session.Abandon
Session("userid") = ""
Response.Redirect("default.asp?tuserid="&Session("userid"))
%>

I want to know the Query String in the link, thanks

Regards,
Wee Siong

0
 
weesiongCommented:
Johannes1979,

Try this my suggestion:
<%
if NOT isempty(request.form ("Login")) then
set conn=server.createobject ("adodb.connection")
conn.open "mydsn", "sayang", "sayang"
set RSFindUser = conn.Execute("select userID from USER1 where " _
& "userID = '" & request.form("userid") & "' and " _
& "password = '" & request.form("password") & "'")
if RSFindUser.EOF then
   TheMessage = "Invalid UserID or Password."
else
   Session("userid") = RSFindUser("userID")
Response.Write(Session("userid"))
Response.Write("Passowrd Correct")
     response.redirect "./main.asp"
end if
end if
%>

I want to know (Session("userid")) and ("Password Correct") will response out or not when ID is correct

Regards,
Wee Siong
0
 
Johannes1979Author Commented:
after change the logout.asp, this the link in the address bar:

http://localhost/project/default.asp?tuserid=



I want to know (Session("userid")) and ("Password Correct") will response out or not when ID is correct===>of course, otherwise, the user can't login.

0
 
Johannes1979Author Commented:
weesiong:
i've send the question in your email.

thank you.
0
 
weesiongCommented:
Johannes1979,

now you want after use login to the page, and the title.asp replace to title2.asp

This is the default.asp (frameset)

<%Response.Expires = 0%>
<html>
<head>
<title>frame_index</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="117,*" frameborder="NO" border="0" framespacing="0" cols="*">
<%IF Session("userid") = "" Then%>
 <frame name="topFrame" scrolling="NO" noresize src="title.asp" >
<%Else%>
 <frame name="topFrame" scrolling="NO" noresize src="title1.asp" >
<%End IF%>
 <frame name="mainFrame" src="defaultpage.asp">
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">

</body></noframes>
</html>

This is the lower frame (defaultpage.asp):

<%@ Language=VBScript %>
<%
if NOT isempty(request.form ("Login")) then
 set conn=server.createobject ("adodb.connection")
 conn.open "mydsn", "sayang", "sayang"
 set RSFindUser = conn.Execute("select userID from USER1 where " _
 & "userID = '" & request.form("userid") & "' and " _
 & "password = '" & request.form("password") & "'")
 if RSFindUser.EOF then
    TheMessage = "Invalid UserID or Password."
 else
    Session("userid") = RSFindUser("userID")
      response.redirect "./main.asp"
 end if
end if
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%response.write themessage %>
<table width="1004" border="0" cellpadding="0" cellspacing="0">
 <tr>
   <td width="308" height="37"></td>
   <td width="62"></td>
   <td width="94"></td>
   <td width="21"></td>
   <td width="11"></td>
   <td width="11"></td>
   <td width="193"></td>
   <td width="15"></td>
   <td width="80"></td>
   <td width="2"></td>
   <td width="207"></td>
 </tr>
 <tr>
   <td height="25"></td>
   <td colspan="9" valign="top"><b><font size="4">If you're already a member,
     please log in....</font></b></td>
   <td></td>
 </tr>
 <tr>
   <td height="38"></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
 </tr>
 <tr>
   <td height="1"></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td rowspan="3" valign="top">
     <form name="form1" method="post" action="defaultpage.asp" target="_parent">
       <p>
         <input type="text" name="userid">
       </p>
       <p>
         <input type="password" name="password">
       </p>
       <p>
         <input type="submit" name="Login" value="Login">
       </p>
     </form>
   </td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
 </tr>
 <tr>
   <td height="157"></td>
   <td></td>
   <td colspan="2" valign="top">
     <p><font size="3" face="Arial, Helvetica, sans-serif">UserID</font></p>
     <p><font size="3" face="Arial, Helvetica, sans-serif">Password</font></p>
   </td>
   <td></td>
   <td valign="top">
     <p>:</p>
     <p>:</p>
   </td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
 </tr>
 <tr>
   <td height="17"></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
 </tr>
 <tr>
   <td height="21"></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
 </tr>
 <tr>
   <td height="28"></td>
   <td colspan="7" valign="top"><b><font size="4">If you are not yet registered....</font></b></td>
   <td></td>
   <td></td>
   <td></td>
 </tr>
 <tr>
   <td height="25"></td>
   <td></td>
   <td></td>
   <td colspan="6" valign="top"><b><font size="4"><a href="register.asp">Join</a>
     now as a NEW member</font></b></td>
   <td></td>
   <td></td>
 </tr>
 <tr>
   <td height="211"></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
 </tr>
</table>
</body>
</html>

Regards,
Wee Siong
0
 
weesiongCommented:
Sorry, it maybe canot work, try this:

This is the default.asp (frameset)
<%Response.Expires = 0%>
<html>
<head>
<title>frame_index</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="117,*" frameborder="NO" border="0" framespacing="0" cols="*">
<%IF Session("userid") = "" Then%>
<frame name="topFrame" scrolling="NO" noresize src="title.asp" >
<%Else%>
<frame name="topFrame" scrolling="NO" noresize src="title2.asp" >
<%End IF%>
<frame name="mainFrame" src="defaultpage.asp">
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">
</body></noframes>
</html>

This is the lower frame (defaultpage.asp):

<%@ Language=VBScript %>
<%
Response.Expires = 0
Response.Buffer = True
%>
<%
if NOT isempty(request.form ("Login")) then
set conn=server.createobject ("adodb.connection")
conn.open "mydsn", "sayang", "sayang"
set RSFindUser = conn.Execute("select userID from USER1 where " _
& "userID = '" & request.form("userid") & "' and " _
& "password = '" & request.form("password") & "'")
if RSFindUser.EOF then
   TheMessage = "Invalid UserID or Password."
else
   Session("userid") = RSFindUser("userID")
%>
<script language="JavaScript">
window.topFrame.location = "title2.asp"
window.location = "./main.asp"
</script>
<%
Response.End
end if
end if
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%response.write themessage %>
<table width="1004" border="0" cellpadding="0" cellspacing="0">
<tr>
  <td width="308" height="37"></td>
  <td width="62"></td>
  <td width="94"></td>
  <td width="21"></td>
  <td width="11"></td>
  <td width="11"></td>
  <td width="193"></td>
  <td width="15"></td>
  <td width="80"></td>
  <td width="2"></td>
  <td width="207"></td>
</tr>
<tr>
  <td height="25"></td>
  <td colspan="9" valign="top"><b><font size="4">If you're already a member,
    please log in....</font></b></td>
  <td></td>
</tr>
<tr>
  <td height="38"></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
</tr>
<tr>
  <td height="1"></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td rowspan="3" valign="top">
    <form name="form1" method="post" action="defaultpage.asp">
      <p>
        <input type="text" name="userid">
      </p>
      <p>
        <input type="password" name="password">
      </p>
      <p>
        <input type="submit" name="Login" value="Login">
      </p>
    </form>
  </td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
</tr>
<tr>
  <td height="157"></td>
  <td></td>
  <td colspan="2" valign="top">
    <p><font size="3" face="Arial, Helvetica, sans-serif">UserID</font></p>
    <p><font size="3" face="Arial, Helvetica, sans-serif">Password</font></p>
  </td>
  <td></td>
  <td valign="top">
    <p>:</p>
    <p>:</p>
  </td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
</tr>
<tr>
  <td height="17"></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
</tr>
<tr>
  <td height="21"></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
</tr>
<tr>
  <td height="28"></td>
  <td colspan="7" valign="top"><b><font size="4">If you are not yet registered....</font></b></td>
  <td></td>
  <td></td>
  <td></td>
</tr>
<tr>
  <td height="25"></td>
  <td></td>
  <td></td>
  <td colspan="6" valign="top"><b><font size="4"><a href="register.asp">Join</a>
    now as a NEW member</font></b></td>
  <td></td>
  <td></td>
</tr>
<tr>
  <td height="211"></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
</tr>
</table>
</body>
</html>

Regards,
Wee Siong
0
 
Johannes1979Author Commented:
weesiong:

when i login now got dialog box:

run time error has occured
Do you wish to debug?

line 2:
error: 'window.topFrame' is not an object

regards,
johannes
0
 
weesiongCommented:
Sorry, change this line:
window.topFrame.location = "title2.asp"
To:
parent.topFrame.location = "title2.asp"

Regards,
Wee Siong
0
 
Johannes1979Author Commented:
ok...
the next problem is now:

First time i open the browser, i type in the address bar like: /localhost/project/main.asp . Then it redirect me to the default.asp page. This is correct (It's done)

In defaultpage.asp, I login then it redirect me to title2.asp (topframe) and main.asp (lowerframe). then i click the logout link in title2.asp (topframe), and it redirect  me to title.asp(topframe) and defaultpage.asp(lowerframe).

From here we see that the linking is working fine.

Then from the browser's address bar i type: /localhost/project/main.asp

it redirects me to main.asp page only, no top frame or lower frame.

What i expect is, it will be redirect to default.asp page after i logout.

Thank you
0
 
weesiongCommented:
Johannes1979,

This is the top frame (title.asp).

<html>
<head>
<title>text berpendar</title>
</head>

<body>

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
<a href="logout.asp" target="_parent">Logout</a>


</body>
</html>


logout.asp
<%
Response.Expires = 0
Session.Abadon
Session("userid") = ""
Response.Redirect("default.asp")
%>


Regards,
Wee Siong
0
 
phuctranCommented:
Johannes1979,

I think it is just the cache.  I test your original pages after adding these lines at the beginning of main.asp (after <%@ language = VBSCRIPT %>, it works fine.

<% Option explicit %>
<% Response.Buffer = TRUE %>
<% Response.Expires = 0%>
<% Response.ExpiresAbsolute = Now - 1%>

0
 
Johannes1979Author Commented:
weesiong:

still the same. I still can directly go to main.asp after logout.
0
 
Johannes1979Author Commented:
phuctran: yes, you are correct.

Now, how can  i divide this points in to two??

150 for pchutran
150 for weesiong

Since weesiong help me to solve the frame problem.
and pchutran solve the cache problem.
Thanks....
0
 
Johannes1979Author Commented:
Attention: Community Support

My question has been answered.

Please award:

150 points and grade A to phuctran
150 pints and grade A to weesiong
0
 
weesiongCommented:
Johannes1979,

Post a question EE Community Support, to ask the EE support team to split the points :)

Regards,
Wee Siong
0
 
weesiongCommented:
No Post in here :)

Regards,
Wee Siong
0
 
ComTechCommented:
Good morning all, Johannes1979 has requested a point slpit for

phuctran=150 points
weesiong=150 points

I will award the accept weesiong here, and another Question will be opened in this Topic Area for 150 points for phuctran.

Thank you
ComTech
Community Support Mdoerator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 20
  • 18
  • 2
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now