469,290 Members | 1,746 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

session logout

hi friends,

i have created session using login details successfully...now i have a doubt that is how can i logout the page....once i logout the page then that previous page cannot be appear.for that how can i write the code in logout.asp page.........

here is my login.asp coding...


<%
Response.Expires = -1000
Response.Buffer = True
If Request.Form("login") = "true" Then
call CheckLogin
Else
call ShowLogin
End If

Sub ShowLogin
<form name=loginform action=login.asp method=post>
<table align="center">
<tr>
<td height="32">USERNAME</td>
<td><input type=text name=username></td>
</tr>
<tr>
<td height="36">PASSWORD</td>
<td><input type=password name=userpwd></td>
</tr>
<tr>
<td height="34" align="center"><input type=submit value="LOGIN"></td>
<td align="center"><input type="reset" value="RESET"></td>
</tr>
</table>
<input type=hidden name=login value=true>
</form>
End Sub

Sub CheckLogin
If LCase(Request.Form("username")) = "fresh" And LCase(Request.Form("userpwd")) = "fresh" Then
Session("UserLoggedIn") = "true"
Response.Redirect "show.asp"
Else
Response.Write("<span class=style4 >")
Response.Write("Login Failed.")
Response.Write("</span><br><br>")
ShowLogin
End If
End Sub
%>
Jul 31 '06 #1
1 16109
hi friends,

i have created session using login details successfully...now i have a doubt that is how can i logout the page....once i logout the page then that previous page cannot be appear.for that how can i write the code in logout.asp page.........

here is my login.asp coding...


<%
Response.Expires = -1000
Response.Buffer = True
If Request.Form("login") = "true" Then
call CheckLogin
Else
call ShowLogin
End If

Sub ShowLogin
<form name=loginform action=login.asp method=post>
<table align="center">
<tr>
<td height="32">USERNAME</td>
<td><input type=text name=username></td>
</tr>
<tr>
<td height="36">PASSWORD</td>
<td><input type=password name=userpwd></td>
</tr>
<tr>
<td height="34" align="center"><input type=submit value="LOGIN"></td>
<td align="center"><input type="reset" value="RESET"></td>
</tr>
</table>
<input type=hidden name=login value=true>
</form>
End Sub

Sub CheckLogin
If LCase(Request.Form("username")) = "fresh" And LCase(Request.Form("userpwd")) = "fresh" Then
Session("UserLoggedIn") = "true"
Response.Redirect "show.asp"
Else
Response.Write("<span class=style4 >")
Response.Write("Login Failed.")
Response.Write("</span><br><br>")
ShowLogin
End If
End Sub
%>
hi
<%
session.abandon
response.redirect "login.asp"
%> like this
Jul 31 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Random | last post: by
reply views Thread by js | last post: by
25 posts views Thread by crescent_au | last post: by
1 post views Thread by mgn2683 | last post: by
4 posts views Thread by Ravigandha | last post: by
6 posts views Thread by Thiago Macedo | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.