alexdin/yii2-file-session 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

alexdin/yii2-file-session

Composer 安装命令:

composer require alexdin/yii2-file-session

包简介

Extention Class for Yii2 File Session based on yii/web/Session

README 文档

README

PHP Yii2. This is an expanding class of web sessions . This class supports retrieving data on session id and deleting it.

Installation

php composer.phar require --prefer-dist alexdin/yii2-file-session

or add

"alexdin/yii2-file-session":"^0.0.2"

Configure

Configure file session add this string to components in config main.php file (main-local.php).

 'session' => [
             // this is the name of the session cookie used for login on the backend
             'class'=>'alexdin\filesession\Session',
             'name' => 'session-name',
             // dir for your path session
             // create migrate if dir is not exists or use "mkdir" function
             'savePath' => __DIR__ . '/../runtime/sessions',
         ],

Usage

Yii::$app->session->destroySession($id)

Clears and deletes the session by id

Yii::$app->session->readSession($id)

Reads the session from the file and returns the serialized data in the string

Yii::$app->session->getSessionData($id)

Returns an array of session data by id

Yii::$app->session->getSessionFileName($id)

Returns the session file name by id

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-08-21