当前位置: 首页>>代码示例>>PHP>>正文


PHP session_status函数代码示例

本文整理汇总了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");
}
开发者ID:GuyOmer,项目名称:Koding,代码行数:7,代码来源:is_logged.php

示例2: __construct

 /**
  * @param string $sessionKey
  */
 public function __construct($sessionKey = 'guardian')
 {
     $this->sessionKey = $sessionKey;
     if (session_status() !== PHP_SESSION_ACTIVE) {
         session_start();
     }
 }
开发者ID:indigophp,项目名称:guardian,代码行数:10,代码来源:Native.php

示例3: __construct

 public function __construct()
 {
     if (session_status() !== PHP_SESSION_ACTIVE) {
         @session_start();
     }
     $this->keyServer = 'marcz@Lab1521.com';
 }
开发者ID:marczhermo,项目名称:Gulp-Bower-Starter,代码行数:7,代码来源:contact.php

示例4: isValid

 public static function isValid()
 {
     if (session_status() !== PHP_SESSION_ACTIVE) {
         session_start();
     }
     return $_SESSION['user']['time'] - time() < 1800 ? true : false;
 }
开发者ID:Hismahil,项目名称:PHPAuth,代码行数:7,代码来源:Session.php

示例5: __construct

 public function __construct()
 {
     if (session_status() != PHP_SESSION_ACTIVE) {
         session_start();
     }
     ob_start();
 }
开发者ID:reservat,项目名称:auth,代码行数:7,代码来源:AuthGateKeeperTest.php

示例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;
 }
开发者ID:menencia,项目名称:locale-detector,代码行数:7,代码来源:NSession.php

示例7: __construct

 public function __construct($timeLimit = 900)
 {
     if (session_status() !== PHP_SESSION_ACTIVE) {
         session_start();
     }
     $this->timeLimit = $timeLimit;
 }
开发者ID:asalov,项目名称:vehicles_network,代码行数:7,代码来源:Session.php

示例8: startSessionIfNecessary

 private static function startSessionIfNecessary()
 {
     if (session_status() === PHP_SESSION_NONE) {
         date_default_timezone_set("America/New_York");
         session_start();
     }
 }
开发者ID:micahherstand,项目名称:shalomshanti,代码行数:7,代码来源:SessionController.php

示例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']);
                 }
             }
         }
     }
 }
开发者ID:baaslk,项目名称:baas.lk,代码行数:26,代码来源:Login.php

示例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;
 }
开发者ID:Marcussacapuces91,项目名称:pico-users,代码行数:30,代码来源:_pico_users.php

示例11: __construct

 public function __construct(DAL $dal)
 {
     if (\session_status() == PHP_SESSION_NONE) {
         assert("No session started");
     }
     $this->dal = $dal;
 }
开发者ID:jabbeboy,项目名称:1dv608writerswall,代码行数:7,代码来源:UseModel.php

示例12: verifySupport

 public function verifySupport()
 {
     if (session_status() == PHP_SESSION_NONE) {
         return false;
     }
     return true;
 }
开发者ID:johnnymast,项目名称:redbox-crawl,代码行数:7,代码来源:Session.php

示例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.");
 }
开发者ID:Calmacil,项目名称:Mf,代码行数:37,代码来源:Application.php

示例14: __construct

 function __construct()
 {
     if (session_status() == PHP_SESSION_NONE) {
         session_start();
     }
     $this->db = new medoo();
 }
开发者ID:Kapulara,项目名称:MineProject,代码行数:7,代码来源:userController.php

示例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();
     }
 }
开发者ID:BoesesGenie,项目名称:rex-framework,代码行数:28,代码来源:FrontController.php


注:本文中的session_status函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。