Skip to content

Commit

Permalink
Fixed issue #9761: CSRF token entropy
Browse files Browse the repository at this point in the history
Dev At least on logout the current CSRF token is renewed
  • Loading branch information
c-schmitz committed Jul 24, 2015
1 parent 5059fc5 commit 72fbac9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion application/controllers/admin/authentication.php
Expand Up @@ -124,7 +124,10 @@ public function logout()
/* Adding beforeLogout event */
$beforeLogout = new PluginEvent('beforeLogout');
App()->getPluginManager()->dispatchEvent($beforeLogout);

// Expire the CSRF cookie
$cookie = new CHttpCookie('cookie_name', $value);
$cookie->expire = time()-3600;
Yii::app()->request->cookies['YII_CSRF_TOKEN'] = $cookie;
App()->user->logout();
App()->user->setFlash('loginmessage', gT('Logout successful.'));

Expand Down

0 comments on commit 72fbac9

Please sign in to comment.