473,671 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to make security logout

subashini Thiyagarajan
218 New Member
when logout pressed the session should expire how to do?

how in yahoo after logging out even if we press browser back it shows to login page like that how to make.
Jan 4 '07 #1
6 2868
karthi84
271 Contributor
hi,
i think this code sample should help u.
Expand|Select|Wrap|Line Numbers
  1. <%Response.Expires = -1 %>
  2. <%Response.ExpiresAbsolute = Now() - 1 %>
  3. <%Response.AddHeader "pragma", "no-cache" %>
  4. <%Response.AddHeader "cache-control", "private" %>
  5. <%Response.CacheControl = "no-cache" %>
  6.  

add this code at the top of the authenticated page.

regards....
Jan 4 '07 #2
sashi
1,754 Recognized Expert Top Contributor
when logout pressed the session should expire how to do?

how in yahoo after logging out even if we press browser back it shows to login page like that how to make.
Hi there,

Another option will be to ditch the current session, kindly refer to below sample code segment, hope it helps. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1. <% Session.Abandon %>
  2.  
p.s/ Make sure to call this method on the last page, any active session / value active during this method call will be set to zero.
Jan 4 '07 #3
subashini Thiyagarajan
218 New Member
Both options are failed for me.i could go back and view the previous pages.
I am new to ASP what other things i need to concentrate.i am not sucessful in security log out.please explain me.how to do?
Jan 4 '07 #4
sashi
1,754 Recognized Expert Top Contributor
Both options are failed for me.i could go back and view the previous pages.
I am new to ASP what other things i need to concentrate.i am not sucessful in security log out.please explain me.how to do?
Hi there,

I wonder why you always jump into conclusions. Understand <Sessions> in ASP first. Sessions are always active as long as your browser window is active. So, close the browser and try to open the same page again, see what happens now.

What is the logic in your Auth page? Kindly refer to below sample, hope you understand better now. Good luck & Take care.

Auth page (login)
Expand|Select|Wrap|Line Numbers
  1.   If <'username & password successfully validated'> Then
  2.      Session("IsLoggedIn") = "yes"
  3.   End If
  4.  
Add this statement on top of every page that you wish to protect
Expand|Select|Wrap|Line Numbers
  1.   If Session("IsLoggedIn") <> "yes" Then
  2.     Response.Redirect "acess_denied.asp"
  3.   End If
  4.  
p.s/ Hope you understand better now.
Jan 4 '07 #5
subashini Thiyagarajan
218 New Member
Yes it works well.thanks a lot...........

but.......

if i choose any page in between login and logout it is not allowing as you explained it is redirecting to the session expired page..

after pressing logout,it means original user logged out.now new user sits in the system and trying to access the data by pressing back button in browser.how to restrict this.
Jan 4 '07 #6
sashi
1,754 Recognized Expert Top Contributor
Yes it works well.thanks a lot...........

but.......

if i choose any page in between login and logout it is not allowing as you explained it is redirecting to the session expired page..

after pressing logout,it means original user logged out.now new user sits in the system and trying to access the data by pressing back button in browser.how to restrict this.
Hi there,

You can make use of several sessions to check on certain status, kindly refer to below sample code segment, hope it helps. Good luck & Take care.

Auth page
Expand|Select|Wrap|Line Numbers
  1.   If <'username & password successfully validated'> Then
  2.      Session("IsLoggedIn") = "yes"
  3.      Session("strUsername") = <username as per in database>
  4.   End If
  5.  
Add this statement on top of every page that you wish to protect
Expand|Select|Wrap|Line Numbers
  1.   If Session("IsLoggedIn") <> "yes" OR Session("strUsername") = vbNullString Then
  2.     Response.Redirect "acess_denied.asp"
  3.   End If
  4.  
Jan 5 '07 #7

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

Similar topics

2
1433
by: Bryan Harrington | last post by:
A little background first.. I'm working from home.. no real team to bounce ideas off of, so you guys are it. I'm working on an app SQL2k / ASP Classic, the quick and dirty is there is a "worklist" of items for users to fix items so that the bill can be payed, and there are also a series of reports. All items are grouped into 1 of 12 categories. Users are members of one of those 12 groups (categories). A users worklist can be "filtered"...
2
3467
by: Jon Natwick | last post by:
I'm trying to add a dynamically created logout link on my pages. The link to the logout page will show if the user is logged in. I put a placeholder on the aspx page and then dynamically create the link, if the user is logged. So far, so good. It's working. Aspx
0
880
by: Joseph Geretz | last post by:
My application software is deployed across two tiers; a WinForms workstation client and a Web Services layer. My application will require authentication, however I'm not keen on building my own authentication services into the application. Rather, I'd like to leverage Windows domain security. I can think of three scenarios: 1. The user is logged in to the domain. In this case, I'm assuming that the user's credentials will be used...
1
3103
by: shapper | last post by:
Hello, I have a link button which signs out the user when it is clicked. I place on by button the code line ibLogout.Visible = My.User.IsAuthenticated. So, when the user is authenticated the button logout is visible. Otherwise is invisible.
10
4064
by: chaos | last post by:
How to do logout alert message when i press on the logout image <a href="../logout.php" target="_top" onClick="return logout()" "MM_nbGroup('down','group1','logout','',1)""MM_nbGroup('down','group1','logout','../button_images/logout_button_down.png',1)" onMouseOver="MM_nbGroup('over','logout','../button_images/logout_button_down.png','../button_images/logout_button_down.png',1)" onMouseOut="MM_nbGroup('out')" ><img name="logout"...
1
14050
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. following are entries in struts-config.xml file <action input="index.jsp" name="loginform" path="/login" scope="session" type="com.myapp.struts.loginaction"> <forward name="success" path="/main.jsp"/>
3
1893
vijcbe
by: vijcbe | last post by:
Hello friends!! Hope someone will fix this issue for me.. I am making a web page in PHP, in which users will enter into their login and do manupulations. After they click logout, the go to the logout page. Here, when they click the back button of the browser, they go to the previous page where they enter the data which should not be shown to anyone else. If this is the case, anyone can see the data that are encrypted and stored in the...
1
3324
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 for the hidden textbox on the logout sub.. but how do i get round this? can i not change the value onclick? <div id=Rightbody> <!--<form id="RightBodyForm" name="RightbodyForm" method="post" action="Guestbook2.asp">--> <% Response.Expires...
5
2808
by: sethia4u | last post by:
Dear Programmers, when I click on logout button I redirect my page to login page again, session variables to null, but when I click on back button previous page is appeared. so plz tell me how I make disable the back button of browser.....
0
8403
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8605
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8677
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5704
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4417
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.