473,395 Members | 1,631 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,395 software developers and data experts.

Logout session

Here is my code that allows access to all the member of my site but when I logout I go to my home page and after pressing the back button I go back to page without logging in

<BODY bgColor=#a996be>
<%
if Not IsNull(Session("loggedInUser")) OR Session("loggedInUser")<>"" then
%>
<DIV id=shape1
style="LEFT: 0px; OVERFLOW: hidden; WIDTH: 800px; POSITION: absolute; TOP: 0px; HEIGHT: 140px; BACKGROUND-COLOR: #6b4d7f"></DIV>
<DIV id=shape2
style="Z-INDEX: 1; LEFT: 0px; OVERFLOW: hidden; WIDTH: 300px; POSITION: absolute; TOP: 125px; HEIGHT: 1px"><IMG
src="Raga online_files/shape2058671.gif" border=0></DIV>
<DIV id=shape3
<TABLE borderColorDark=#808080 bgColor=#a996be borderColorLight=#c0c0c0
border=0>
<TBODY>
<TR vAlign=top>
<TD width=55 height=13>
<DIV class=wpmd>
<DIV><A class=style2
href="index.html">LOGOUT</A></DIV>
</DIV></TD></TR></TBODY></TABLE></DIV></DIV></DIV>
<%
else
Response.Redirect("Invalid.html")
end if
%></BODY></HTML>
Nov 8 '07 #1
1 4576
omerbutt
638 512MB
it wont make any difference cause it wont enter any data and if u refresh that page after clicking the back button it will redirect u to the login page or home page that u have redirected it to........another solution to that is
SESSION.ABANDON...........u should use it in ur logout file after u specify session=false or vot ever u specify in ur logout page for example
here is the code of my logout page WHERE I ASSIGN A NULL VALUE to empty the session
LOGOUT.asp
Expand|Select|Wrap|Line Numbers
  1. <%    
  2. if request("logout") = "Logout" then
  3.   Session("Valid") = ""
  4.  
  5.   response.redirect("Home.asp")    
  6. end if
  7. %>
  8.  
Add the following file into each page of ur site by using #INCLUDE, WHAT THIS FILE DO IS THAT WHENEVER THE PAGE IS LOADED IT WILL CHECK IF THE SESSION IS NULL OR NOT IF YES THEN IT REDIRECTS U TO THE LOGIN PAGE
SECURE.asp
Expand|Select|Wrap|Line Numbers
  1. <%@Language=VBScript%>
  2. <%Option Explicit%>
  3. <%
  4.  If Session("Valid") = "" Then 
  5.     Response.redirect ("login.asp") 
  6.  End If
  7. %>
  8.  
HOPE THIS MIGHT HELP U

Here is my code that allows access to all the member of my site but when I logout I go to my home page and after pressing the back button I go back to page without logging in

<BODY bgColor=#a996be>
<%
if Not IsNull(Session("loggedInUser")) OR Session("loggedInUser")<>"" then
%>
<DIV id=shape1
style="LEFT: 0px; OVERFLOW: hidden; WIDTH: 800px; POSITION: absolute; TOP: 0px; HEIGHT: 140px; BACKGROUND-COLOR: #6b4d7f"></DIV>
<DIV id=shape2
style="Z-INDEX: 1; LEFT: 0px; OVERFLOW: hidden; WIDTH: 300px; POSITION: absolute; TOP: 125px; HEIGHT: 1px"><IMG
src="Raga online_files/shape2058671.gif" border=0></DIV>
<DIV id=shape3
<TABLE borderColorDark=#808080 bgColor=#a996be borderColorLight=#c0c0c0
border=0>
<TBODY>
<TR vAlign=top>
<TD width=55 height=13>
<DIV class=wpmd>
<DIV><A class=style2
href="index.html">LOGOUT</A></DIV>
</DIV></TD></TR></TBODY></TABLE></DIV></DIV></DIV>
<%
else
Response.Redirect("Invalid.html")
end if
%></BODY></HTML>
Nov 25 '07 #2

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

Similar topics

0
by: konsu | last post by:
hello, i need to implement a secure web site in php and mysql but i have just started looking at php a few days ago, and i would appreciate any advice from the experts. the site, as i said,...
4
by: ad | last post by:
I use the Login controls of Asp.net 2.0 in my program. I want to logout a user by program, I try Session.Abandon() for this. But I found that the user is the same after I execute Session.Abandon()....
2
by: AAOMTim | last post by:
I want to automatically logout if certain conditions occur in my application. Calling Session.Abandon() does not force a logout. What can I do? -- Tim
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: shrik | last post by:
hi everybody. I have following problem. There are two pages. index.jsp and main.jsp in my application Index.jsp contains logging interface in . It submits password and userid to loginform bean. ...
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: shahidrasul | last post by:
hi in my project when i click on logout anchor it goes to logout page and my code in logout page is if (Session != null) { Session = null; Session.Abandon(); ...
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...
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
2
by: phpmagesh | last post by:
Hi to all, I have created a page with login and logout. i used session to register the login user and when he clicks in logout, it will destroy the session. this is nice but if system is...
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
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?
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.