diff --git a/php/AuthSCHClient.class.php b/php/AuthSCHClient.class.php index df0b268711abb3f5062249945e8547df516ccc93..8a9d6eeb50afbc093d81043b0a883fb1b1fea2db 100644 --- a/php/AuthSCHClient.class.php +++ b/php/AuthSCHClient.class.php @@ -9,10 +9,10 @@ class AuthSCHClient { private $tokens; - public function __construct($checkLogin = true) { + public function __construct($tokens = null) { $this->tokens = new stdClass(); - if($checkLogin === true) { + if($tokens === null) { if(session_id() == '') { // session isn't started session_set_cookie_params(3600,"/"); @@ -31,6 +31,8 @@ class AuthSCHClient { // load tokendata from session $this->tokens = unserialize($_SESSION['tokens']); } + } else { + $this->tokens = $tokens; } return $this->tokens;