Merge branch 'development' into 'master'

Fixed incorrect sessions deletion issue.

See merge request xevidos/codiad!11
This commit is contained in:
Isaac Brown 2018-07-24 09:47:07 -04:00
commit 988c07b0f4

View File

@ -57,6 +57,7 @@ class User
$_SESSION['user'] = $this->username;
$_SESSION['lang'] = $this->lang;
$_SESSION['theme'] = $this->theme;
$_SESSION['login_session'] = true;
if ($user['project']!='') {
$_SESSION['project'] = $user['project'];
}
@ -112,8 +113,9 @@ class User
session_id( $session );
session_start();
//echo var_dump( $_SESSION ) . "\n\n";
if ( ( isset( $_SESSION["user"] ) && $_SESSION["user"] == $username ) || empty( $_SESSION ) ) {
$_SESSION['lang'] = $this->lang;
$_SESSION['theme'] = $this->theme;
if ( ( isset( $_SESSION["user"] ) && $_SESSION["user"] == $username && ( isset( $_SESSION['lang'] ) && isset( $_SESSION['theme'] ) ) && isset( $_SESSION['login_session'] ) && $_SESSION['login_session'] == true ) || empty( $_SESSION ) ) {
session_unset();
session_destroy();