473,511 Members | 15,715 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 2866
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
1428
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...
2
3462
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...
0
871
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...
1
3098
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...
10
4045
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()"...
1
14031
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. ...
3
1889
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...
1
3313
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...
5
2802
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...
0
7251
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
7148
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
7367
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
5673
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,...
1
5072
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...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
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 ...
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.