承接 selective/samesite-cookie 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

selective/samesite-cookie

最新稳定版本:0.5.0

Composer 安装命令:

composer require selective/samesite-cookie

包简介

Secure your site with SameSite cookies

README 文档

README

A PSR-15 middleware to secure your site with SameSite cookies ????

Latest Version on Packagist Software License Build Status Total Downloads

Requirements

  • PHP 8.1 - 8.4

Installation

composer require selective/samesite-cookie 

SameSite cookies

image

Same-site cookies ("First-Party-Only" or "First-Party") allow servers to mitigate the risk of CSRF and information leakage attacks by asserting that a particular cookie should only be sent with requests initiated from the same registrable domain.

Warning: SameSite cookies doesn't work at all for old Browsers and also not for some Mobil Browsers e.g. IE 10, Blackberry, Opera Mini, IE Mobile, UC Browser for Android.

Further details can be found here:

Slim 4 integration

<?php use Selective\SameSiteCookie\SameSiteCookieMiddleware; use Slim\Factory\AppFactory; $app = AppFactory::create(); // ... // Register the samesite cookie middleware $app->add(new SameSiteCookieMiddleware()); // ... $app->run();

Example with configuration and the session starter middleware.

Slim 4 uses a LIFO (last in, first out) middleware stack, so we have to add the middleware in reverse order:

<?php use Selective\SameSiteCookie\SameSiteCookieConfiguration; use Selective\SameSiteCookie\SameSiteCookieMiddleware; use Selective\SameSiteCookie\SameSiteSessionMiddleware; use Slim\Factory\AppFactory; $app = AppFactory::create(); // ... // Optional: Add custom configuration $configuration = new SameSiteCookieConfiguration(); // Register the samesite cookie middleware $app->add(new SameSiteCookieMiddleware($configuration)); // Optional: Start the PHP session // Use this middleware only if you have no other session starter middleware $app->add(new SameSiteSessionMiddleware()); // ... $app->run();

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 142.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固