定制 district5/simple-session-store 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

district5/simple-session-store

最新稳定版本:1.1.0

Composer 安装命令:

composer require district5/simple-session-store

包简介

SimpleSessionStore is a session management library for PHP

README 文档

README

SimpleSessionStore is a session management library for PHP. It was originally part of OhSession.

Class overview:

  • \District5\SimpleSessionStore\Session
    • Controls the basic Session functionality that's needed for applications of any size. The primary goal of this class is to provide a simplistic interface to interact with session data.
  • \District5\SimpleSessionStore\Storage
    • Provides a Session Namespace approach to storing data for a users session.

Usage

  • Example Composer file contents:
    {
      "require": {
          "district5/simple-session-store": ">=1.1.0"
      }
    }  
  • Set a value:
    <?php
    $sess = \District5\SimpleSessionStore\Session::getInstance();
    if ($sess->set('foo', 'bar') === true) {
        // set ok.
    }
  • Get a value:
    <?php
    $sess = \District5\SimpleSessionStore\Session::getInstance();
    $val = $sess->get('foo');
    if ($val !== false) {
        // get ok
    }
  • Remove a key:
    <?php
    $sess = \District5\SimpleSessionStore\Session::getInstance();
    if ($sess->remove('foo') === true) {
        // remove ok
    }
  • Remove all keys:
    <?php
    $sess = \District5\SimpleSessionStore\Session::getInstance();
    if ($sess->removeAll() === true) {
        // remove all ok
    }
  • Destroy the session (and optionally regenerate):
    <?php
    $sess = \District5\SimpleSessionStore\Session::getInstance();
    if ($sess->destroy(true) === true) { // or pass false if you don't want to regenerate a session.
        // destroy ok
    }

统计信息

  • 总下载量: 149
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2022-01-14