original_string: function create_session($data){
  
  		$key = Env::getConfig("jwt")->get('key');
  		$expiration = Env::getConfig("jwt")->get('token_expiration');
  		$cookie_key=   Env::getConfig("jwt")->get('cookie_key');
  		$token = array(
  				"iss" => $_SERVER['HTTP_HOST'],
  				"iat" => time(),
  				"nbf" => time(),
  				"exp" => time()+($expiration),
  				"data" =>  $data
  		);
  
  		$jwt = JWT::encode($token, $key);
  
  		$this->setToken($jwt);
  		$_SESSION[$cookie_key]=$jwt;
  		setcookie($cookie_key,$jwt,time()+$expiration,'/');
  		//var_dump($cookie_key);
  		Env::getRequest()->setToken($jwt);
  		$this->setDefaultDatas($data);
  	}
code: function create_session($data){
  
  		$key = Env::getConfig("jwt")->get('key');
  		$expiration = Env::getConfig("jwt")->get('token_expiration');
  		$cookie_key=   Env::getConfig("jwt")->get('cookie_key');
  		$token = array(
  				"iss" => $_SERVER['HTTP_HOST'],
  				"iat" => time(),
  				"nbf" => time(),
  				"exp" => time()+($expiration),
  				"data" =>  $data
  		);
  
  		$jwt = JWT::encode($token, $key);
  
  		$this->setToken($jwt);
  		$_SESSION[$cookie_key]=$jwt;
  		setcookie($cookie_key,$jwt,time()+$expiration,'/');
  		//var_dump($cookie_key);
  		Env::getRequest()->setToken($jwt);
  		$this->setDefaultDatas($data);
  	}
code_tokens: function create_session ( $ data ) { $ key = Env :: getConfig ( "jwt" ) -> get ( 'key' ) ; $ expiration = Env :: getConfig ( "jwt" ) -> get ( 'token_expiration' ) ; $ cookie_key = Env :: getConfig ( "jwt" ) -> get ( 'cookie_key' ) ; $ token = array ( "iss" => $ _SERVER [ 'HTTP_HOST' ] , "iat" => time ( ) , "nbf" => time ( ) , "exp" => time ( ) + ( $ expiration ) , "data" => $ data ) ; $ jwt = JWT :: encode ( $ token , $ key ) ; $ this -> setToken ( $ jwt ) ; $ _SESSION [ $ cookie_key ] = $ jwt ; setcookie ( $ cookie_key , $ jwt , time ( ) + $ expiration , '/' ) ; //var_dump($cookie_key); Env :: getRequest ( ) -> setToken ( $ jwt ) ; $ this -> setDefaultDatas ( $ data ) ; }
docstring: Create a jwt user session
docstring_tokens: Create a jwt user session