CSRFVerifyToken()

edit

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

edit
key = "+nn7jqV+3hYHM++RuvE47g==";
new_token = CSRFGenerateToken(key, true);
dump(CSRFVerifyToken(new_token,key)); //true

See also