If a user comes to a page that needs a login, I give them an error  
and a link to a login page.  I have the login set a cookie and then  
returns the user to the original page that needed a login:

<cfcookie name="fsnep_login" value="#validate_user.login_id[1]#">
<cfset the_loc = "#session.return_url##del#login_return=true">
<cflocation url="#the_loc#" addtoken="no">

It returns to the url with a url variable. With the return variable  
attached, the page then checks for the cookie and allows the user  
in.  And if the user chooses to use the logout button, it works fine  
(foreshadowing).
Unfortunately without the url variable attached, it doesn't correctly  
find the cookie and says that the user must log in again.  So if  
they're returned to the page with the url variable attached, they are  
"logged in", otherwise, it appears that they're not, even though they  
are.  I do the check like this:

<cfif NOT isDefined('cookie.fsnep_login')>

Now, if I change it to <cfif NOT structKeyExists(cookie,'fsnep_login') 
 >, it works fine.  I can go to the page, it asks for a login, I  
login and am returned, works fine.  I then type in the page, without  
the url variable appended and it still works fine.  The cookie is  
there and it sees it.  Unfortunately with this scenario, when the  
logout button is clicked, and then I return to the page, it still  
acts as if I'm logged in, unless I append a url variable <sigh>.  ???
Here's the logout code:

<cfset j = structDelete(cookie,'fsnep_login',true)>
<cfcookie name="fsnep_login" expires="now">
<cfset k = structDelete(session,'return_url',true)>
<cfset i = structDelete(session,'fsnep_login',true)>


This is on PC IE

thanks for any help.
_____________________________

Daniel Kessler

College of Health and Human Performance
University of Maryland
Suite 2387 Valley Drive
College Park, MD  20742-2611
Phone: 301-405-2545
http://hhp.umd.edu




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222292
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to