> I am trying to implement a user registration system. I have
> done this before for clients using either client or session
> variables, depending on the need. This particular client wants
> to have a "save password" checkbox on the registration form
> so that if the box is not checked, the user will have to log
> in again next time, similar to the "remember me" feature on
> Yahoo etc.
>
> This site is likely to be upgraded to a cluster in future so
> I am steering away from session variables in favor of client
> variables. However, I can't think of a way to stop ColdFusion
> "remembering" the client variables if the user unchecks the
> "save password" option. AFAIK, if you don't explicitly delete
> the client variables, they will persist for that client through
> the next session regardless. Since I can't know when the client
> session ends, I can't delete the variables just for that client.
>
> Am I better off "rolling my own" cookie-based user tracking
> system? Or is there a way to get client variables to do what I want?

You could just make sure that if the user clears the check box, their
cookies don't persist after they close their browser, by overwriting the
cookies with non-persistent cookies:

<cfif not IsDefined("Form.RememberMe")>
        <cfcookie name="CFID" value="#Cookie.CFID#">
        <cfcookie name="CFTOKEN" value="#Cookie.CFTOKEN#">
</cfif>

By omitting the EXPIRES parameter within the CFCOOKIE tag, you'll create
cookies that will be discarded when the browser is closed. Note that you
might want to add various error handlers to this stuff.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to