定制 ellipse/session-start 二次开发

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

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

ellipse/session-start

Composer 安装命令:

composer require ellipse/session-start

包简介

Psr-15 middleware allowing to use session with Psr-7 request and response

README 文档

README

This package provides a Psr-15 middleware allowing to use session with Psr-7 request and response.

Require php >= 7.0

Installation composer require ellipse/session-start

Run tests ./vendor/bin/kahlan

Using the start session middleware

This middleware use the default php session mechanism adapted to Psr-7 request and response flow. The default php session cookie is disabled and the session id is manually stored in a cookie readed from the Psr-7 request and attached to the Psr-7 response.

By default values returned by session_name() and session_get_cookie_params are used to build the session cookie. An optional array of options can be given to the middleware in order to overwrite those default values:

  • (string) name: the session cookie name
  • (string) path: the session cookie path
  • (string) domain: the session cookie domain
  • (int) lifetime: the session cookie lifetime in second
  • (bool) secure: whether the session cookie should only be sent over secure connections
  • (bool) httponly: whether the session cookie can only be accessed through the HTTP protocol

The middleware can of course be used after the SessionHandlerMiddleware from ellipse/session-handler in order to use a custom session handler.

<?php

namespace App;

use Ellipse\Session\StartSessionMiddleware;

// All middleware processed after this one will have acces to the $_SESSION data.
// The session cookie name will by 'my_session_cookie'. See above for other options.
$middleware = new StartSessionMiddleware([
    'name' => 'my_session_cookie',
]);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固