定制 websoftwares/session 二次开发

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

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

websoftwares/session

Composer 安装命令:

composer require websoftwares/session

包简介

PHP 5.3+ Session Class that accepts optional save handlers.

关键字:

README 文档

README

PHP 5.3+ Session Class that accepts optional save handlers.

Build Status

Installing via Composer (recommended)

Install composer in your project:

curl -s http://getcomposer.org/installer | php

Create a composer.json file in your project root:

{
    "require": {
        "websoftwares/session": "dev-master"
    }
}

Install via composer

php composer.phar install

Usage

Basic usage of the Session class.

use Websoftwares\Session;

// Instantiate class
$session = new Session;

// Start session
$session->start();

// Store in session
$session["key"] = 'value';

var_dump($_SESSION);

// Destroy
$session->destroy();

Options

U can override the default options by instantiating a Session class and pass in an array as the second argument.

$options = array(
    // If enabled (default) extra meta data is added (name,created,updated)
    'meta' => true,
    // Provide custom session name
    'name' => null,
    'lifetime' => 0,
    'path' => '/',
    'domain' => null,
    'secure' => true,
    'httponly' => false
);

// Instantiate class
$session = new Session(null,$options);

start();

Start a new session.

$session->start();

destroy();

Destory the session.

$session->destroy();

close();

Close the session.

$session->close();

active();

Find out if their is a session active.

$session->active();

id($string);

Set session id, Get current/previous session id.

$session->id($string);

regenerate();

Regenerate session id, optional bool true for session deletion.

$session->regenerate();

ArryAccess

U can access the session object as an array.

$session["key"] = "value";

Testing

In the tests folder u can find several tests.

License

DBAD Public License.

Acknowledgement

All the great session managment solutions.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: DBAD
  • 更新时间: 2013-08-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固