Solved

logout

Posted on 2001-07-03
46
1,069 Views
Last Modified: 2008-03-17
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
Comment
Question by:Johannes1979
  • 20
  • 18
  • 2
  • +5
46 Comments
 
LVL 20

Expert Comment

by:jitganguly
ID: 6249923
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
 
LVL 3

Expert Comment

by:ckaneta
ID: 6249961
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
 

Author Comment

by:Johannes1979
ID: 6250064
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
 
LVL 20

Expert Comment

by:jitganguly
ID: 6250078
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
 
LVL 33

Expert Comment

by:hongjun
ID: 6250874
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251080
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
 

Author Comment

by:Johannes1979
ID: 6251195
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251211
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
 

Author Comment

by:Johannes1979
ID: 6251225
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
 

Author Comment

by:Johannes1979
ID: 6251229
The top frame for after successfully log in is:

"title2.asp"
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6251245
Johannes1979,

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

Regards,
Wee Siong
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6251247
Johannes1979

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

Regards,
Wee Siong
0
 

Author Comment

by:Johannes1979
ID: 6251249
wee siong, it still the same.
The title.asp(top frame) file didn't change in the next page.
0
 

Author Comment

by:Johannes1979
ID: 6251255
and i still can go to the main.asp after i click logout.
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6251287
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
 
LVL 3

Expert Comment

by:ckaneta
ID: 6251306
did you try abandoning the session and then loading the page containing the frameset?
0
 

Author Comment

by:Johannes1979
ID: 6251320
weesiong: got the top frame in any pages. First time also got top frame.

ckaneta: yes.
0
 

Author Comment

by:Johannes1979
ID: 6251326
Seems it is difficut, i increase the points  :P
0
 
LVL 14

Expert Comment

by:puranik_p
ID: 6251378
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251387
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251402
Johannes1979,

and try add

<%Response.Expires = 0%>

in each page header

Regards,
Wee Siong
0
 

Author Comment

by:Johannes1979
ID: 6251443
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
 

Author Comment

by:Johannes1979
ID: 6251458
I think this is related to the previous post in EE.

http://www.experts-exchange.com/jsp/qShow.jsp?qid=20090891#1
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 7

Expert Comment

by:weesiong
ID: 6251478
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251481
Johannes1979,

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

Regards,
Wee Siong
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6251508
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
 

Author Comment

by:Johannes1979
ID: 6251561
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
 

Author Comment

by:Johannes1979
ID: 6251579
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
 

Author Comment

by:Johannes1979
ID: 6251586
i' ll send to you weesiong by email, for the code. give me 5 minutes :)
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6251587
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251597
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
 

Author Comment

by:Johannes1979
ID: 6251623
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
 

Author Comment

by:Johannes1979
ID: 6251631
weesiong:
i've send the question in your email.

thank you.
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6251644
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
 
LVL 7

Accepted Solution

by:
weesiong earned 150 total points
ID: 6251657
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
 

Author Comment

by:Johannes1979
ID: 6251690
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251708
Sorry, change this line:
window.topFrame.location = "title2.asp"
To:
parent.topFrame.location = "title2.asp"

Regards,
Wee Siong
0
 

Author Comment

by:Johannes1979
ID: 6251745
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251767
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
 
LVL 3

Expert Comment

by:phuctran
ID: 6251778
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
 

Author Comment

by:Johannes1979
ID: 6251784
weesiong:

still the same. I still can directly go to main.asp after logout.
0
 

Author Comment

by:Johannes1979
ID: 6251800
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
 

Author Comment

by:Johannes1979
ID: 6251840
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
 
LVL 7

Expert Comment

by:weesiong
ID: 6251850
Johannes1979,

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

Regards,
Wee Siong
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6251852
No Post in here :)

Regards,
Wee Siong
0
 

Expert Comment

by:ComTech
ID: 6252256
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

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