473,241 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

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 16504
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

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

Similar topics

1
by: Random | last post by:
I have an <asp:LinkButton runat="server" id="btnLogin"/> control that I use in my page header for login/logout link. Depending on the session state when the page loads, I set the .Text and...
0
by: js | last post by:
In my project I have both ASPX and classic ASP. Four things in question are the entry page(Main.aspx), the logon page(logon.ASP), .Net Session, legacy ASP Session. The Main.apsx contains a Logon...
25
by: crescent_au | last post by:
Hi all, I've written a login/logout code. It does what it's supposed to do but the problem is when I logout and press browser's back button (in Firefox), I get to the last login page. In IE,...
1
by: gnewsgroup | last post by:
I am using forms authentication for a web application. Like many other member web application, my web application prints out Welcome! John Doe (Logout) on the top right corner of each...
1
by: mgn2683 | last post by:
I am working on a project using Dreamweaver CS3, and I am not very familiar with html or php code. Essentially I am trying to set something up so that a user is allowed to enter information into...
1
by: Kandiman | last post by:
Hiya, i made a asp page, and one of my divs (as a include) is as below. the problem is if the main page is resubmitted, i get logged out again?... heres the code.. i think its on the value=true...
4
by: Ravigandha | last post by:
Hello everbody, My problem is.My code is working in localhost but not working when i upload it to website.In this case is it the problem with the hosting server or with php sessions as i have used....
6
by: Thiago Macedo | last post by:
I could not find on the web a complete solution for this task. This is not the perfect solution, because it's doesn't have the ability to log the logout if browser crash or user leave it open while...
4
by: dgourd | last post by:
I have a a PHP script that does all the logging in and creating session. I also have some javascript that uses AJAX to make a request to the PHP script and return the response. The problem I run...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.