本文整理汇总了PHP中session_status函数的典型用法代码示例。如果您正苦于以下问题:PHP session_status函数的具体用法?PHP session_status怎么用?PHP session_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了session_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: islogged
function islogged()
{
if (session_status() === PHP_SESSION_ACTIVE) {
return;
}
redirect("login.php");
}
示例2: __construct
/**
* @param string $sessionKey
*/
public function __construct($sessionKey = 'guardian')
{
$this->sessionKey = $sessionKey;
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
}
示例3: __construct
public function __construct()
{
if (session_status() !== PHP_SESSION_ACTIVE) {
@session_start();
}
$this->keyServer = 'marcz@Lab1521.com';
}
示例4: isValid
public static function isValid()
{
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
return $_SESSION['user']['time'] - time() < 1800 ? true : false;
}
示例5: __construct
public function __construct()
{
if (session_status() != PHP_SESSION_ACTIVE) {
session_start();
}
ob_start();
}
示例6: detect
public function detect()
{
if (session_status() === PHP_SESSION_ACTIVE && isset($_SESSION[self::$fieldName]) && !empty($_SESSION[self::$fieldName])) {
return collator_create($_SESSION[self::$fieldName]);
}
return null;
}
示例7: __construct
public function __construct($timeLimit = 900)
{
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
$this->timeLimit = $timeLimit;
}
示例8: startSessionIfNecessary
private static function startSessionIfNecessary()
{
if (session_status() === PHP_SESSION_NONE) {
date_default_timezone_set("America/New_York");
session_start();
}
}
示例9: __construct
public function __construct()
{
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
//login with session data
if (isset($_GET["logout"])) {
$this->Logout();
} else {
if (isset($_COOKIE['rememberme'])) {
$this->loginWithCookies();
} else {
if (!empty($_SESSION['username']) && $_SESSION['loginstatus'] == 1) {
//echo "session";
$this->loginWithSessionData();
} else {
if (isset($_POST["login"])) {
if (!isset($_POST['user_rememberme'])) {
$_POST['user_rememberme'] = null;
}
$this->loginWithPostData($_POST['user_name'], $_POST['user_password'], $_POST['user_rememberme']);
}
}
}
}
}
示例10: check_login
function check_login()
{
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
$fp = $this->fingerprint();
$post = $_POST;
// to sanitize ?
// logout action
if (isset($post['logout'])) {
unset($_SESSION[$fp]);
return;
}
// login action
if (isset($post['login']) && isset($post['password'])) {
return $this->login($post['login'], $post['password'], $fp);
}
// session login (already logged)
if (!isset($_SESSION[$fp])) {
return;
}
$name = $_SESSION[$fp]['name'];
$pass = $_SESSION[$fp]['password'];
$logged = $this->login($name, $pass, $fp);
if ($logged) {
return true;
}
unset($_SESSION[$fp]);
return;
}
示例11: __construct
public function __construct(DAL $dal)
{
if (\session_status() == PHP_SESSION_NONE) {
assert("No session started");
}
$this->dal = $dal;
}
示例12: verifySupport
public function verifySupport()
{
if (session_status() == PHP_SESSION_NONE) {
return false;
}
return true;
}
示例13: __construct
/**
* Application constructor. This is the entry point of Calmacil/Mf.
* @param string $root
* @param string $env
*/
public function __construct($root, $env = 'prod')
{
parent::__construct($root);
define('ROOT', $root);
$this->env = $env;
$this->cfile = "settings_" . $this->env;
Config::init(ROOT . '/config/');
// Loggers
$rotateHandler = new RotatingFileHandler(ROOT . Config::get($this->cfile)->log->logfile, 10, Config::get($this->cfile)->log->loglevel);
$processor = new PsrLogMessageProcessor();
$this->loggers['core'] = new Logger('core');
$this->loggers['app'] = new Logger('app');
$this->loggers['core']->pushHandler($rotateHandler);
$this->loggers['app']->pushHandler($rotateHandler);
$this->loggers['core']->pushProcessor($processor);
$this->loggers['app']->pushProcessor($processor);
if (Config::get($this->cfile)->debug) {
$browserHandler = new BrowserConsoleHandler();
$this->loggers['core']->pushHandler($browserHandler);
$this->loggers['app']->pushHandler($browserHandler);
}
$this->coreLogger()->addNotice("============================================================");
// Session service handling
if (session_status() !== PHP_SESSION_DISABLED) {
$this["session"] = new SessionPlugin($this);
}
$this->router = Router::getInstance(ROOT . Config::get($this->cfile)->paths->routing_file, $this);
$this->request = new Request($this, $_SERVER['REQUEST_URI']);
$this->response = new Response($this);
$this->coreLogger()->addNotice("------------------------------------------------------------");
$this->coreLogger()->addNotice("Application initialized.");
}
示例14: __construct
function __construct()
{
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
$this->db = new medoo();
}
示例15: run
/**
* Запуск программы, единая точка входа.
*/
public static function run()
{
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
$instance = new FrontController();
try {
$instance->init();
$instance->handleRequest();
} catch (\REXFramework\exceptions\AppException $e) {
$e->process();
} catch (\PDOException $e) {
if (ob_get_length()) {
ob_end_clean();
}
$myException = new \REXFramework\exceptions\AppException($e->getMessage());
$myException->process();
} catch (\Exception $e) {
if (ob_get_length()) {
ob_end_clean();
}
header('HTTP/1.0 404 Not Found');
echo $e->getMessage();
}
}