<?php
/* Please see the README and LICENSE files. */
/*
* License
*/
class User_Session {
protected $username;
protected $user_id;
public function __construct($user_id, $username) {
$this->username = $username;
$this->user_id = $_SESSION['user_id'] = $user_id;
}
protected function __get($name) {
if (property_exists($this, $name)) {
return $this->$name;
}
}
public static function exists(){
return isset($_SESSION['user_id'])?true:false;
}
}
?>