Description

Validates the given token against the same stored in the session for a specific key.

Returns

a Boolean value. true is successful.

Category

Display and formatting functions

Syntax

CSRFVerifyToken(token [,key])

See also

CSRFGenerateToken

History

ColdFusion 10: Added this function.

Parameters

Parameter

Required\Optional

Description

token

required

Token that to be validated against the token stored in the session.

key

Optional

The key against which the token be searched.

Usage

Use this function to validate the given token against the same stored in the session for a specific key.

Example

<cfset token=form.token> 
<cfset validate = CSRFverifyToken(token)> 
<cfoutput >#validate#</cfoutput>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy