Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » can't view the website after logging out while in draft mode

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1539 Views
  • martimiz
    Avatar
    Forum Moderator
    1068 Posts

    can't view the website after logging out while in draft mode Link to this post

    When I log out of the backend after viewing my site in draft mode, I cannot access the live website as an 'anonymous user': requesting the root of my website now redirects me to the login screen. I can force access by manually adding ?stage=Live to the url - which could be by design but then I wouldn't be so happy about it

    In Mozilla (XP, v3.0.3) though, even after that, just requesting the root of the site won't work. Flushing sometimes helps... The only way to avoid this is by restarting the browser or removing the PHP session ID from the cookies list.

    Could this maybe be altered so that logging out automatically resets the php session id values? Please dont think I don't appreciate the good work though - because I really do

  • martimiz
    Avatar
    Forum Moderator
    1068 Posts

    Re: can't view the website after logging out while in draft mode Link to this post

    To anyone who's interested: I created a temporary (I hope) solution in the function logOut() (sapphire/security/Member.php line 174) by adding an extra line of code:

    function logOut() {
       Session::clear("loggedInAs");

       # my solution: clear reference to Stage
       Session::clear("currentStage");

       self::session_regenerate_id();

       $this->RememberLoginToken = null;
       Cookie::set('alc_enc', null);
       Cookie::forceExpiry('alc_enc');

       $this->write();
    }

    1539 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.