public static function _init() { \Config::load('complexauth', true, true, true); if (\Config::get('complexauth.remember_me.enabled', false)) { static::$remember_me = \Session::forge(array('driver' => 'cookie', 'cookie' => array('cookie_name' => \Config::get('complexauth.remember_me.cookie_name', 'rmcookie')), 'encrypt_cookie' => true, 'expire_on_close' => false, 'expiration_time' => \Config::get('complexauth.remember_me.expiration', 86400 * 31))); } }
/** * Share session with http server * * @param $conn \Ratchet\ConnectionInterface */ public static function get_session(\Ratchet\ConnectionInterface $conn) { \Session::clear_instances(); /** * Set cookie */ $cookie = $conn->WebSocket->request->getHeader('cookie'); $data = \Guzzle\Parser\ParserRegistry::getInstance()->getParser('cookie')->parseCookie($cookie); $_COOKIE = $data['cookies']; /** * Set remote address */ $x_forwarded_for = $conn->WebSocket->request->getHeader('x-forwarded-for'); $_SERVER['REMOTE_ADDR'] = !empty($x_forwarded_for) ? $x_forwarded_for : $conn->remoteAddress; /** * Set user agent * * TODO: How to get user agent like remote address */ \Config::load('session', true); \COnfig::set('session.match_ua', false); try { $session = \Session::forge(); } catch (\Exception $e) { $session = null; } /** * Remove data */ $_SERVER['REMOTE_ADDR'] = null; $_COOKIE = null; \Session::clear_instances(); return $session; }
/** * Load the config and setup the remember-me session if needed */ public static function _init() { // var_dump("sajan"); exit; \Config::load('cmsauth', true); // setup the remember-me session object if needed if (\Config::get('cmsauth.remember_me.enabled', false)) { static::$remember_me = \Session::forge(array('driver' => 'cookie', 'cookie' => array('cookie_name' => \Config::get('cmsauth.remember_me.cookie_name', 'rmcookie')), 'encrypt_cookie' => true, 'expire_on_close' => false, 'expiration_time' => \Config::get('cmsauth.remember_me.expiration', 86400 * 31))); } }
public static function _init() { // load the auth config \Config::load('ormauth', true, true, true); // deal with invalid column selections if ($columns = \Config::get('ormauth.table_columns', array()) == array('*') or !is_array($columns)) { \Config::set('ormauth.table_columns', array()); } // setup the remember-me session object if needed if (\Config::get('ormauth.remember_me.enabled', false)) { static::$remember_me = \Session::forge(array('driver' => 'cookie', 'cookie' => array('cookie_name' => \Config::get('ormauth.remember_me.cookie_name', 'rmcookie')), 'encrypt_cookie' => true, 'expire_on_close' => false, 'expiration_time' => \Config::get('ormauth.remember_me.expiration', 86400 * 31))); } }
/** * get and set submit redirection url * * @return string */ private function getAndSetSubmitRedirection() { $session = \Session::forge(); if ($session->get('submitted_redirect') == null) { if (\Input::referrer() != null && \Input::referrer() != \Uri::main()) { $session->set('submitted_redirect', \Input::referrer()); return \Input::referrer(); } else { $redirect_uri = 'dbhelper/admin'; $session->set('submitted_redirect', $redirect_uri); return $redirect_uri; } } else { return $session->get('submitted_redirect'); } }
public function __construct(\Smarty $smarty) { $session = Session::forge(); $smarty->assign('session', $session); }