473,386 Members | 1,828 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,386 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 16530
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.