public static function start() { if (!self::$started) { session_start(); } self::$started = true; }
public static function reload() { session_write_close(); self::$started = false; usleep(200); self::start(); }
public static function destroy() { session_destroy(); unset($_SESSION); self::$started = false; Log::set(__METHOD__ . LOG_SEP . 'Session destroyed.'); return !isset($_SESSION); }
static function loggedIn() { if (!Session::started()) { $_SESSION['error_message'] = "Access denied. Please Log In to view this page"; View::render('index.php'); return false; } return true; }
public static function start() { if (ini('base/SESSION/CUSTOM')) { if (ini('base/SESSION/SAVE') == 'file') { ini_set('session.save_path', Package::get_folder(ini('base/SESSION/DIR'))); } } @session_start(); self::$started = true; }
public static function start() { if (self::$started) { return; } self::read(); self::$started = true; $result = Db::row("SELECT u.id_personas\n , CONCAT(u.nombre, ' ', u.apellido) AS nombre\n FROM personas u\n WHERE u.usuario = '" . self::$usuario . "'\n AND u.contrasena = '" . self::$contrasena . "'\n LIMIT 1"); self::$id = $result['id_personas']; self::$nombre = $result['nombre']; }
function start() { if (!self::$started) { self::var_setup(); self::ini_setup(); self::$user_agent = $_SERVER['HTTP_USER_AGENT']; self::$ip = $_SERVER['REMOTE_ADDR']; if (!self::$session_use_only_cookies && array_key_exists('sess_id', $_REQUEST)) { session_id($_REQUEST['sess_id']); } session_start(); self::$id = session_id(); self::$started = true; self::validate(); } }
include PATH_HELPERS . 'text.class.php'; include PATH_HELPERS . 'log.class.php'; include PATH_HELPERS . 'date.class.php'; include PATH_HELPERS . 'theme.class.php'; include PATH_HELPERS . 'session.class.php'; include PATH_HELPERS . 'redirect.class.php'; include PATH_HELPERS . 'sanitize.class.php'; include PATH_HELPERS . 'valid.class.php'; include PATH_HELPERS . 'email.class.php'; include PATH_HELPERS . 'filesystem.class.php'; include PATH_HELPERS . 'alert.class.php'; include PATH_HELPERS . 'paginator.class.php'; include PATH_HELPERS . 'image.class.php'; // Session Session::start(); if (Session::started() === false) { Log::set('init.php' . LOG_SEP . 'Error occurred when trying to start the session.'); exit('Bludit. Failed to start session.'); } // Objects $dbPosts = new dbPosts(); $dbPages = new dbPages(); $dbUsers = new dbUsers(); $dbTags = new dbTags(); $Site = new dbSite(); $Url = new Url(); $Parsedown = new ParsedownExtra(); $Security = new Security(); // --- Relative paths --- // This paths are relative for the user / web browsing. // Base URL
static function destroy($id) { if (!self::$started) { return; } self::$started = false; session_unset(); //frees the variables (like $_SESSION) self::$data->delete(); self::$data = null; Cookie::remove('sessionId'); Cookie::remove('sessionKey'); }
/** * Destroys all data registered to a session. * @return void */ public function destroy() { if (!self::$started) { throw new InvalidStateException('Session is not started.'); } session_destroy(); $_SESSION = NULL; self::$started = FALSE; if (!$this->getHttpResponse()->isSent()) { $params = session_get_cookie_params(); $this->getHttpResponse()->deleteCookie(session_name(), $params['path'], $params['domain'], $params['secure']); } }
function start() { if (!self::$started) { @session_start(); self::$started = true; } }
static function start() { if (!self::$started) { session_set_cookie_params(0, AppConfig::BASE_URL); session_start(); self::$started = true; } }
* GNU General Public license for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category FluxBB * @package Core * @copyright Copyright (c) 2008-2012 FluxBB (http://fluxbb.org) * @license http://www.gnu.org/licenses/gpl.html GNU General Public License */ define('FLUXBB_VERSION', '2.0-alpha1'); Autoloader::namespaces(array('fluxbb' => __DIR__ . DS . 'classes')); if (fluxbb\Core::installed()) { Request::set_env('fluxbb'); } // Set up our custom session handler if (!Request::cli() && !Session::started()) { Session::extend('fluxbb::session', function () { return new fluxbb\Session\Driver(Laravel\Database::connection()); }); Config::set('session.driver', 'fluxbb::session'); Session::load(); } // View composers require 'helpers/composers.php'; // Route filters require 'helpers/filters.php'; // HTML helpers require 'helpers/html.php'; // Validators require 'helpers/validator.php';
/** * Start or continue a session * * @uses ini_set() * @uses $ip * @uses is_valid_host() * @uses session_id() * @uses session_start() * @uses $user_agent */ function start_session() { if (!self::$started) { self::init(); header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); self::$ip = self::get_client_ip(); self::$user_agent = $_SERVER['HTTP_USER_AGENT']; if (self::is_valid_host() && array_key_exists('sess_id', $_REQUEST)) { session_id($_REQUEST['sess_id']); } session_cache_limiter("must-revalidate"); session_start(); self::$id = session_id(); self::$started = true; } $hash = self::get_hash(); if (!isset($_SESSION[$hash])) { $_SESSION[$hash] = array(); } }