Permalink
Browse files

BUGFIX Avoid infinite redirection when logging out and when showing a…

… custom login page after displaying the draft version of a page.
  • Loading branch information...
1 parent 5f9348b commit c048a019f69d8e7b44f50576c7d1d35765b0aa58 jean committed with chillu Feb 9, 2012
Showing with 5 additions and 2 deletions.
  1. +4 −1 security/Member.php
  2. +1 −1 security/Security.php
View
5 security/Member.php
@@ -421,9 +421,12 @@ public function logOut() {
$this->extend('memberLoggedOut');
$this->RememberLoginToken = null;
- Cookie::set('alc_enc', null);
+ Cookie::set('alc_enc', null); // // Clear the Remember Me cookie
Cookie::forceExpiry('alc_enc');
+ // Switch back to live in order to avoid infinite loops when redirecting to the login screen (if this login screen is versioned)
+ Session::clear('readingMode');
+
$this->write();
// Audit logging hook
View
2 security/Security.php
@@ -951,7 +951,7 @@ public static function ignore_disallowed_actions() {
*/
public static function set_login_url($loginUrl) {
self::$login_url = $loginUrl;
- }
+}
/**
* Get the URL of the log-in page.
* Defaults to Security/login but can be re-set with {@link set_login_url()}

0 comments on commit c048a01

Please sign in to comment.