.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 5th, 2004, 08:05 AM
radha radha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 18 radha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Logout (without getting page using back button)

hi everybody
i would like to have a logout page which is very secure so that if the user clicks on the back button , he will not be able to view the previous page. i think i must use the session object for it. Anybody knows how to do it?

Reply With Quote
  #2  
Old March 5th, 2004, 10:07 AM
bombaywala bombaywala is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 150 bombaywala User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 38 sec
Reputation Power: 5
Hi - I forgot how I had implemented this with JSP - years back. I remember killing all the cookies from client m/c when they hit logout and if they tried refreshing their page - I displayed - the page you are trying to access has been destroyed (I dont remember what I did to create this functionality). I have never done this with .NET though.

Reply With Quote
  #3  
Old March 5th, 2004, 03:46 PM
ps124 ps124 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: London
Posts: 37 ps124 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
hi......
yea u gotta use sessions. i just done that for my own coursework.....u'll find ur answer at the following link.....

http://forums.aspfree.com/t23306/s....=Authentication

you just put this piece of code after the user logs in......

session("userValid") = "Yes"

and put this piece of code on EVERY page u want to make secure....

Sub Page_Load

if Session("userValid") = "Yes" then
Else
Response.redirect("Login.aspx")
End IF

End Sub


let me know if that worked for you.....

Reply With Quote
  #4  
Old March 7th, 2004, 02:04 AM
radha radha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 18 radha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs down

Quote:
Originally Posted by ps124
hi......
yea u gotta use sessions. i just done that for my own coursework.....u'll find ur answer at the following link.....

http://forums.aspfree.com/t23306/s....=Authentication

you just put this piece of code after the user logs in......

session("userValid") = "Yes"

and put this piece of code on EVERY page u want to make secure....

Sub Page_Load

if Session("userValid") = "Yes" then
Else
Response.redirect("Login.aspx")
End IF

End Sub


let me know if that worked for you.....


thanks for your reply ps 124 but no it didn`t work;i tried it, i think is for ASP not ASP.Net . Shouldn`t we use something like "if session expires then ..."? what you told me doesnot prevent the previous page from appearing when i click on BACK after logging out. Any idea on how to do it in ASP.net?The link you gave me doesnot work , please give it again, i wanted to have a look at it.

If anybody else knows, please tell me. Thanks

Last edited by radha : March 7th, 2004 at 02:07 AM.

Reply With Quote
  #5  
Old March 7th, 2004, 09:52 PM
ps124 ps124 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: London
Posts: 37 ps124 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Talking

hi radha......

u indian by the way???? lol, same here.........but yea this code is for asp.net......

ive done it for my own coursework just a few days back and i can tell u for sure it works for me. look at the link again, it explains it better anyway.....but its for asp.net for sure.

leme kno again ok........

Reply With Quote
  #6  
Old March 7th, 2004, 10:53 PM
radha radha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 18 radha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi ps124
i am Mauritian, not Indian .
Yes, i wanted to have a look at the link, but it does not work please post it again, thanks.

Reply With Quote
  #7  
Old March 12th, 2004, 03:43 AM
radha radha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 18 radha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb Logout

hi ps124
i have tried the code again, but it has a problem . it works perfectly only when i enable trace, telling me that the page has expired when i click on back after logging in, but when trace is disabled, i can get the previos page when i click on back. I think it has something to do with caching. Do u have any idea on it?

Does anybody else know how we can implement the apge so that after logging out it will not be available when we click on back?

Thanks

Reply With Quote
  #8  
Old May 19th, 2004, 03:32 AM
ajegopinath's Avatar
ajegopinath ajegopinath is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 180 ajegopinath User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 51 m 19 sec
Reputation Power: 5
To logout

Just use the code in 'logout.aspx' page_load event
Sesseion.Abandon()

And mention the code in 'Web.config' file
Authentication area

<authentication mode="Forms">
<forms name="userId" loginUrl="/login.aspx" path="/">
</forms>
</authentication>
mention ur loginpage name in 'loginUrl' attribute. and check it and send ur feedback.

Regards
-Gopi

Reply With Quote
  #9  
Old May 19th, 2004, 06:25 AM
schott19 schott19 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 7 schott19 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Im not sure but i think it is something to do with the caching of the pages.

Checking the session variable on the form_load of each page will only work if you refresh a page or open a new one.

I think what your talking about is when you click back on the browser. The page that is displayed is got from the cahce.

You will need to clear the cache when the user logs out. However, im not sure how to do it but a quick search on google should sort you out.

let me know if you find a solution to this

regards

Dave

Reply With Quote
  #10  
Old May 19th, 2004, 07:30 AM
ajegopinath's Avatar
ajegopinath ajegopinath is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 180 ajegopinath User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 51 m 19 sec
Reputation Power: 5
Clear the cache

To clear the cache.
use the code in Page_Load event.

Response.Expires = -100
Response.CacheControl = "no-cache"

Regards
-Gopi

Reply With Quote
  #11  
Old May 21st, 2004, 10:22 AM
radha radha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 18 radha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi dave
Caching was exactly the problem. Here is the solution which works for me:
Response.CacheControl="no-cache"
Response.AddHeader("Pragma", "no-cache")
Response.Expires=-1
this removes the page from te hcache so that the user can't get the previous page upon clicking on back. Session variables do not solve the problem.

Reply With Quote
  #12  
Old May 30th, 2004, 05:39 AM
kabayan kabayan is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 kabayan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
logout

Quote:
Originally Posted by ajegopinath
Just use the code in 'logout.aspx' page_load event
Sesseion.Abandon()

And mention the code in 'Web.config' file
Authentication area

<authentication mode="Forms">
<forms name="userId" loginUrl="/login.aspx" path="/">
</forms>
</authentication>
mention ur loginpage name in 'loginUrl' attribute. and check it and send ur feedback.

Regards
-Gopi

hello gopi

just wanted to ask you if you could explain what does this procedures do specially in making a logout page.

i am a newbie in asp .net, and i am creating a logout page but it seems that if i click the back button it just reurns to
the previous page and the user can continue on using the system.

ill w8 4 ur response. thanks a lot

regards,

kabayan

Reply With Quote
  #13  
Old June 2nd, 2004, 11:53 AM
ajegopinath's Avatar
ajegopinath ajegopinath is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 180 ajegopinath User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 51 m 19 sec
Reputation Power: 5
Do the following steps

Hi,
Two steps
1. For every page_Load event add the code
Response.CacheControl="no-cache"
Response.AddHeader("Pragma", "no-cache")
Response.Expires=-1


Just use the code in 'logout.aspx' page_load event
Sesseion.Abandon()
And mention the code in 'Web.config' file
Authentication area
<authentication mode="Forms">
<forms name="userId" loginUrl="/login.aspx" path="/">
</forms>
</authentication>
mention ur loginpage name in 'loginUrl' attribute. and check it and send ur feedback.

Regards
-Gopi

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Logout (without getting page using back button)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |