Link to home
Start Free TrialLog in
Avatar of jtreher
jtreher

asked on

How can I restart a session

If the user clicks the log out button, I'm doing a structclear of the session scope. This means that any subsequent pages will not have the cfid or cftoken defined, so what I need to do is actually destroy the current session and restart a new one all in the same chunk of code. I happen to be doing this in onRequestStart

Thanks.
Avatar of dgrafx
dgrafx
Flag of United States of America image


Why not do the structclear on a "logout" page

<cfset StructClear(session)>  of course to clear the struct
<then locate back to a home page or login or whatever>
aborting immediately after
<cfabort>

This is assuming you have some code in place that creates the session if it doesn't exist that is called when user comes to the site.
Avatar of jtreher
jtreher

ASKER

Hmmm, the URL token is the only thing that shows up in the session scope. cfid and cftoken will not recreate themselves unless the browser is shut down.

i'm calling onSessionEnd() and then onSessionStart
Possibly you need to recreate them manually within your onSessionEnd
ASKER CERTIFIED SOLUTION
Avatar of JeffHowden
JeffHowden

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jtreher

ASKER

Sorry about the delay, I will check into this because I really am using a substructure as well.