demianturner / sgl-docs-tickets-migration-test

0 stars 0 forks source link

LoginMgr::logout destroys session - is this required? #1525

Open demianturner opened 11 years ago

demianturner commented 11 years ago

In the logout command gets the session destroyed:

{{{ SGL_Session::destroy(); }}}

This leads to the fact that current language settings are no longer available within the HTTP::redirect method and so, he cannot keep the site's language. Can we remove this session destroy call? Or do I have to write a work around? I think keeping current language after logout would be nice.

demianturner commented 11 years ago

[biggs] Update: Just removing the destroy call does no longer logout the user. For testing I added code to save the current language before the session gets destroyed and set it after re-creating it again. This would work and can be added in the destroy function.

{{{ $c = &SGL_Config::singleton(); $conf = $c->getAll();

    if (isset($_SESSION) && isset($_SESSION['aPrefs']['language'])) {
        $curLang = $_SESSION['aPrefs']['language'];
    }

}}}

{{{ $sess = & new SGL_Session(); if (isset($curLang)) { $_SESSION['aPrefs']['language'] = $curLang; } }}}

One thing I have in mind: When there will be a statistics module in the future, logging out would mean the user will be treated as new user after logout. (Cause it's a new session) So you can not analysis what an user does after logout when he is still on the site. Am i right here?