CSRFVerifyToken()
Validates the given token against the same stored in the session for a specific key.
CSRFVerifyToken( token=string, key=string, remove=boolean );
Returns: Boolean
| Argument | Description | Default |
|---|---|---|
|
token
string,
required
|
edit
Token that to be validated against the token stored in the session. |
|
|
key
string,
optional
|
edit
The key against which the token be searched. |
|
|
remove
boolean,
optional
|
edit
Also remove the token from the session if it exists. |
false |
Examples
editkey = "+nn7jqV+3hYHM++RuvE47g==";
new_token = CSRFGenerateToken(key, true);
dump(CSRFVerifyToken(new_token,key)); //true
See also
- Cryptography
- Session
- CSRFGenerateToken()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)