I'm not sure why you have this behaviour. I have two remarks on your
code:
1. The sessiontimeout/applicationtimeout in <cfapplication take a
timeout as a value, NOT yes/no.
2. What I do to easily clear session info, is creating the variables in
a structure. Then you can use structDelete on the session and delete the
entire structure. You can add session info later and you don't have to
change the logout code.


in your application.cfm, you would change the code to
<cfapplication name="Inside" clientmanagement="Yes"
sessionmanagement="Yes" sessiontimeout="#CreateTimeOut(0,2,0,0)#"
applicationtimeout="#CreateTimeOut(2,0,0,0)#">
<cflock scope="session" timeout="20">
    <CFPARAM name="session.info" DEFAULT="#structNew()#">
    <CFPARAM name="session.info.LoggedIn" DEFAULT="FALSE">
</cflock>


In your login, replace session by session.info


And logout becomes
<cflock scope="session" timeout="20">
    <CFSET StructDelete(Session, "info")>

</cflock>
<cflocation url="" addtoken="no">

A good way to track what's happening in your session is to simply dump
it <cfdump var="#session#">.
You can see if some vars don't get deleted.


Pascal

-----Original Message-----
From: Michael Grove [mailto:[EMAIL PROTECTED]
Sent: zondag 16 november 2003 16:42
To: CF-Talk
Subject: HELP - Logout (sessionDelete, StructClear)?

I have written an application that allows a user to log in.
When the user logs in I run the following code...

I first check to see if the user exisits. If so...
<CFIF CheckUser.RecordCount GREATER THAN 0>
  <CFSET Session.LoggedIn = True>
<CFELSE>
  <CFSET Session.LoggedIn = False>
</cfif>

Then I set some session variables

<CFIF Session.LoggedIn EQ True>
  <CFSET Session.AuthUserID = Trim(CheckUser.UserID)>
  <CFSET Session.AuthMemberID = Trim(CheckUser.member_id)>
  <CFSET Session.AuthAccountTypeSeller =
Trim(CheckUser.accounttypeseller)>
  <CFSET Session.AuthAccountTypeBidder =
Trim(CheckUser.accounttypeBidder)>
  <SCRIPT LANGUAGE="_javascript_">
  self.location ='https://foo';
  </SCRIPT>
<CFELSE>
  return them to the home page
</cfif>

This works fine. The problem I am having is that when they press logout.
It does not really logo them out. Here is my logout code...

<CFSET StructDelete(Session, "LoggedIn")>
<CFSET StructDelete(Session, "AuthUserID")>
<CFSET StructDelete(Session, "MemberID")>
<CFSET StructDelete(Session, "AuthAccountTypeBidder")>
<CFSET StructDelete(Session, "AuthAccountTypeSeller")>
<CFIF isDefined("session.AuthUserID")>
Log Off Failed....
<CFELSE>
Logging Off.....
<cflocation url="" addtoken="no">
</cfif>

It does send them back to the home page, but if I log in with a
different ID, I am still accessing the site with the account I just
logged out with.

HELP...I have tried everything I could think of and it is still not
logging them out.

I have an application file running with this...

<cfset hrsBeforeTimeout = 2>
<cfapplication name="Inside" clientmanagement="Yes"
sessionmanagement="Yes" sessiontimeout="Yes" applicationtimeout="Yes">
<CFPARAM name="session.LoggedIn" DEFAULT="FALSE">

<cfparam name="BidPlaced" default="0">

Not sure if that will make a difference.

Thanks
  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to