I want to know how Laravel:
creates CSRF tokens
where it is located
expiration time
When I refresh the web page I see the same token that was already created and how increase or decrease expiration time?
In laravel/vendor/laravel/framework/src/Illuminate/Session/Store.php there is a function called regenerateToken()
( github )
/**
* Regenerate the CSRF token value.
*
* @return void
*/
public function regenerateToken()
{
$this->put('_token', Str::random(40));
}
It just uses a 40 character long random string as you can see.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.