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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFID, CFTOKEN contains invalid characters

Status
Not open for further replies.

maximos

Technical User
Sep 27, 2002
109
CA
HI everyone,
I have a form where user could update some feild in a database in a secure area , ( after an application.cfm login )
everything works fine if the user try to do the update once, if he tries to update anything else before loging out and in again, we receive this message
" CFID, CFTOKEN contains invalid characters" and the error occur in : sessionmanagement="yes"

Here is my application.cfm codes,

<cfapplication name=&quot;login&quot;
clientmanagement=&quot;yes&quot;
sessionmanagement=&quot;yes&quot;
sessiontimeout=&quot;#createtimespan(0,0,15,0)#&quot;>

<cfset dsn=&quot;stock&quot;>

<cflogin>

<!--- If not logged in user, or login form not submitted,
include the login form--->
<cfif NOT isDefined(&quot;Form.username&quot;)>
<cfinclude template=&quot;login.cfm&quot;>

<cfabort>
<cfelse>
<cfif IsDefined(&quot;Cookie.CFID&quot;) AND IsDefined(&quot;Cookie.CFTOKEN&quot;)>
<cfset Variables.cfid_local = Cookie.CFID>
<cfset Variables.cftoken_local = Cookie.CFTOKEN>
<cfcookie name=&quot;CFID&quot; value=&quot;#Variables.cfid_local#&quot;>
<cfcookie name=&quot;CFTOKEN&quot; value=&quot;#Variables.cftoken_local#&quot;>

</cfif>
<!------>

<!--- :The user has submitted the form, but either the name
or password is blank, so include the form again --->
<cfif Form.username is &quot;&quot; OR Form.password is &quot;&quot;>
<cfinclude template=&quot;login.cfm&quot;>
<h3>You must enter text in both the User ID and Password fields.</h3>
<cfabort>
<cfelse>

<!--- The user has submitted name and password, check the database for
match --->
<cfquery name=&quot;qValidLogin&quot; datasource=&quot;stock&quot;>
SELECT *
FROM tblMember
WHERE tblMember.MemberName = '#Form.username#' AND Password = '#Form.password#' </cfquery>
<!--- The user has submitted a valid name and password --->
<cfif qValidLogin.RecordCount>
<cfloginuser name=&quot;#Form.username#&quot; password=&quot;#Form.password#&quot; roles=&quot;#qValidLogin.Roles#&quot;>
<cfset loggedin=&quot;1&quot;>
<cfset session.userid = #qValidLogin.MemberName#>
<!--- User has submitted invalid name and/or password,
so show the form again --->
<cfelse>
<cfinclude template=&quot;login.cfm&quot;>
<h3>Your information is not valid.;Please try again.</h3>
<cfabort>
</cfif>
</cfif>
</cfif>

</cflogin>

I'm using CFMX Ver 6.1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top