Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging Out of Application

Status
Not open for further replies.

scripter73

Programmer
Joined
Apr 18, 2001
Messages
421
Location
US
Hi,

I have an application that uses session variables. On the last page of my application, I want the user to click a link that will ultimately log them out and redirect them to the start of the application.

I've set it up so that when user clicks on link, it calls a program logout.cfm:


<cflock timeout=&quot;1&quot; name=&quot;#session.sessionid#&quot; type=&quot;exclusive&quot;>
<cfset structclear(session)>
</cflock>
<cflocation url = &quot;


But I'm getting the message, &quot;Error resolving parameter SESSION.SESSIONID


The session variable SESSIONID does not exist. The cause of this error is very likely one of the following things:


The name of the session variable has been misspelled.
The session variable has not yet been created.
The session variable has timed out.
&quot;


Here's what my application.cfm file looks like also:


<cfapplication name=&quot;charter&quot;
clientmanagement = &quot;YES&quot;
sessionmanagement = &quot;YES&quot;>


I know that I have session variables set throughout my app.

Why isn't it logging out and redirecting to my page? Please advise when you can.

Thanks,
scripter73
 
Heres my logout script that works great, give it a try.
<CFAPPLICATION NAME=&quot;MyName&quot;
SESSIONMANAGEMENT=&quot;Yes&quot;
SETCLIENTCOOKIES=&quot;Yes&quot;
SESSIONTIMEOUT=&quot;#CreateTimeSpan(0,0,20,0)#&quot;>
<CFIF ISDEFINED(&quot;Cookie.CFID&quot;) AND ISDEFINED(&quot;Cookie.CFTOKEN&quot;)>
<CFSET CFID_LOCAL = COOKIE.CFID>
<CFSET CFTOKEN_LOCAL = COOKIE.CFTOKEN>
<CFCOOKIE NAME=&quot;CFID&quot; VALUE=&quot;#cfid_local#&quot;>
<CFCOOKIE NAME=&quot;CFTOKEN&quot; VALUE=&quot;#cftoken_local#&quot;>
</CFIF>

<CFLOCATION URL=&quot;
 
Is this for the Logout.cfm or for the Application.cfm?
 
I don't think this is your problem, but to make sure try changing your CFLOCK tag NAME to SCOPE:

<CFLOCK SCOPE=&quot;SESSION&quot; TIMEOUT=&quot;1&quot; TYPE=&quot;EXCLUSIVE&quot;>
<CFSET structclear(session)>
</CFLOCK>

If this isn't it, then check your error to see where it's coming from, it could be coming from a different template or a different part of the LOGIN page. - tleish
 
I'm having the same problem w/ the sesson.sessionID - How exactly does that work? Why would sessionID NOT EXIST?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top