Fail CSRF token checks if the session expires. (#4598)
Fixes #4595. Credit to @bennothommo
This commit is contained in:
parent
5723cd4b2a
commit
0240c21af6
|
|
@ -786,7 +786,7 @@ class Controller extends ControllerBase
|
|||
|
||||
$token = Request::input('_token') ?: Request::header('X-CSRF-TOKEN');
|
||||
|
||||
if (!strlen($token)) {
|
||||
if (!strlen($token) || !strlen(Session::token())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1596,7 +1596,7 @@ class Controller
|
|||
|
||||
$token = Request::input('_token') ?: Request::header('X-CSRF-TOKEN');
|
||||
|
||||
if (!strlen($token)) {
|
||||
if (!strlen($token) || !strlen(Session::token())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue