Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2005, 02:17 AM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to birari
Default Logout Problem

hello everybody,
               I am preparing an asp login logout script with session variables.But i am facing a problem that after i successfully log out from my page, i can go to the previous page by using the back button.How can i curb this problem that whenever i go to the previous page after logging out i should get the message as to that my session has expired.
Can any body please help me.


Chetan Birari
     birari_chetan@rediffmail.com
 
Old March 24th, 2005, 02:20 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii birari !!

Have you Abandoned the session using session.abandon
on click of logout button/link.




Cheers :)

vinod
 
Old March 24th, 2005, 02:26 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

1..When someone logs on set some variable. I assign their unique ID to a variable called EG session(ID")

2..When someone logs out call session.abandon (removes all session variable values)

3..Now in the HEAD of EVERY PAGE that requires the user to be logged in put something like:

<%
IF session("ID") = "" then
  'user is not logged in or has logged out
  response.redirect("somePage.asp")
END IF
%>



Wind is your friend
Matt
 
Old March 24th, 2005, 08:27 AM
Authorized User
 
Join Date: Feb 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear birari ,

 Leave all the things .. make an ASP page page & include just these few lines
 Home.asp represents the desired page which should be opened after clicking the logoff button . give action of page to the page on which u are writing these lines ..

<% session.Abandon %>
<script>
open ("home.asp","_top")
</script>

Cheers ,

Kamal Kant Singh
+91-9810481159




 
Old March 28th, 2005, 08:14 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I would use ASP's response object to redirect - why use a browser dependent method when you dont have to.

Wind is your friend
Matt
 
Old August 10th, 2006, 07:58 AM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to birari_chetan
Default

Thannks

 
Old August 18th, 2006, 02:31 AM
Registered User
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to albertindian2000
Default

Sometimes (but most of the times) when you click back button page displayed will be from cache or temporary files. There is no specific solution for this because your cache will store the html content and it is not retrived from server. But when you click any other link it will say the session exipred message or redirect to login screen

 
Old September 1st, 2006, 12:22 AM
Authorized User
 
Join Date: Dec 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shahhussain Send a message via Yahoo to shahhussain
Default

hello there use this little code with the Session.Abandon to clear you privious link form the user.
use this :
<%
Session.Abandon
%>
<SCRIPT LANGUAGE="JavaScript">
window.location.replace ("home.asp");
</script>
it will replace your history back button with new location home.asp
::::::::::::::::::::::: ::::: :::::::: ::::::

Shahhussain





Similar Threads
Thread Thread Starter Forum Replies Last Post
logout problem badboy1 ASP.NET 3.5 Basics 3 July 22nd, 2008 08:32 AM
Logout problem dayaananthanm ASP.NET 2.0 Professional 2 December 7th, 2006 04:57 AM
Logout problem xylo ASP.NET 2.0 Basics 1 July 8th, 2005 05:44 AM
login logout problem... sunmeet122 Classic ASP Professional 2 April 15th, 2004 09:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.