Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class SessionManager{
- public function __construct() {
- session_start();
- }
- public function is_exist($a){
- return isset($_SESSION["system".$a]);
- }
- public function add($a,$b){
- $_SESSION["system".$a]=$b;
- }
- public function addCookies($a,$b){
- setcookie($a, $b, time() + (86400 * 30), "/"); // 86400 = 1 day
- }
- public function sessionKey(){
- return session_id();
- }
- public function value($k){
- if(!isset($_SESSION[$k]))
- $this->close("SESSION_NOT_DEFINED".__LINE__);
- return $_SESSION[$k];
- }
- public function __get($key)
- {
- echo "tried to call $key";
- return get_instance()->$key;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement