James,

Realize that if you just do a StructClear(session), that you will lose your
CFID and CFToken for that session. It's been my experience in the past that
I want to keep those two things around but clear everything else.

If it's a question of whether a user is logged in or not, I suggest keeping
a session.loggedin variable. Then when your user triggers some logout method
(or whatever) you can set that variable to false and also clear whatever
else you need/want to. Of course, this means that your code would always
need to check if the user is logged in before performing any duties that
would require the user be logged in first. And of course there are pages
that you would want to run whether the user is logged in or not... like the
login page. ;o)

Hope this helps!

Cheers,
Chris


On 8/2/07, Brian Kotek <[EMAIL PROTECTED]> wrote:
>
> StructClear(session)
>
> On 8/2/07, James Smith <[EMAIL PROTECTED]> wrote:
> >
> > Is there any way to end a session when a logout link is clicked?
> >
> > I have tried...
> > <cfset temp = onSessionEnd(session,application)>
> > <cfapplication name="application"
> > sessiontimeout="#createTimeSpan(0,0,0,0)#">
> >
> > But it leaves the session scope fully populated.
> >
> > I have even tried...
> > <cfset temp = onSessionEnd(session,application)>
> > <cfapplication name=" application "
> > sessiontimeout="#createTimeSpan(0,0,0,0)#">
> > <cfset temp = structClear(sesion)>
> > <cflocation url="/">
> >
> > But that doesn't work either.  I am sure I am missing something simple
> but
> > this is driving me nuts!
> >
> > --
> > Jay
> >
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285241
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to