定制 badcfe/partitioned-sessions 二次开发

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

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

badcfe/partitioned-sessions

Composer 安装命令:

composer require badcfe/partitioned-sessions

包简介

README 文档

README

PHP util to allow setting of partitioned cross site or third party cookies for PHP sessions

Why might I need this package?

You want to implement a session in PHP with the partitioned attribute.

This package also adds the prefixes __Secure and __Host to the session cookie name when they are appropriate.

How to use

The idea is to use the session_set_cookie_params() as you would normally in PHP to set nearly all the functionality of the library.

You can set a session cookie like this. FancySessionCookies::startNewSession(); By default if the cookie could be set as partioned it will be.

Accessing a session is done using the default PHP methods e.g.

$_SESSION['last_access'] = time();

var_dump($_SESSION['last_access']);
// int(1713867921)

Is this necessary?

No it should not be but currently partitioned cookies for sessions will require an RFC to be accepted into PHPs core functions. This package is designed as stop gap till the RFC is accepted and then all instances of FancySessionCookies::startNewSession(); can be replaced with session_start()

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-05