PHPackages                             fullfatthings/samesiteexceptions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fullfatthings/samesiteexceptions

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fullfatthings/samesiteexceptions
================================

provide exceptions to the same site flag depending on browser strings

v1.0.3(5y ago)229.1k↓38.9%2Apache-2.0PHPPHP &gt;=5.3

Since Feb 19Pushed 5y ago3 watchersCompare

[ Source](https://github.com/fullfatthings/samesiteexceptions)[ Packagist](https://packagist.org/packages/fullfatthings/samesiteexceptions)[ RSS](/packages/fullfatthings-samesiteexceptions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

SAME SITE EXCEPTION PHP LIBRARY
===============================

[](#same-site-exception-php-library)

[![PHP Tests](https://github.com/fullfatthings/samesiteexceptions/workflows/PHP%20Tests/badge.svg)](https://github.com/fullfatthings/samesiteexceptions/actions?query=workflow%3A%22PHP+Tests%22)[![codecov](https://camo.githubusercontent.com/f64a92ad0a0ab8b7c6e4412b72ef1afd17c24608c9394fe324f163a0b0cb9373/68747470733a2f2f636f6465636f762e696f2f67682f66756c6c6661747468696e67732f73616d6573697465657863657074696f6e732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/fullfatthings/samesiteexceptions)

This is a light weight library you can include if you need to set samesite cookies but also need to account for older browsers that have issues with accepting them.

There is currently a backwards compatible breaking change in the way Chrome 70+ handles cookies, this means that you have to set SameSite=None as a cookie header for some cross site cookies to work in Chrome, but some older browsers will reject this cookie and fail to work. This library will set an appropriate SameSite header for the current user agent.

It is a PHP version of the pseudocode outlined [here](https://www.chromium.org/updates/same-site/incompatible-clients)

Usage
=====

[](#usage)

To include this in in your application type `composer require fullfatthings/samesiteexceptions`

Then when you are setting a cookie with a same site value use

`$safe_value = \FullFatThings\SameSiteException\SameSiteException::getSafeString($same_site_value);`

If the safe value returned is null you should not add a samesite value (even blank) to the cookie you are setting.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~86 days

Total

5

Last Release

1936d ago

PHP version history (2 changes)1.0.1PHP &gt;5.6

1.0.2PHP &gt;=5.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fcf25ee0937bead5e3999417bff8d7302c95291cea6116ee8ffaf7c3749f08b?d=identicon)[jeremyfrench](/maintainers/jeremyfrench)

---

Top Contributors

[![jeremyfrench](https://avatars.githubusercontent.com/u/237838?v=4)](https://github.com/jeremyfrench "jeremyfrench (55 commits)")[![jairlopez](https://avatars.githubusercontent.com/u/2719644?v=4)](https://github.com/jairlopez "jairlopez (1 commits)")[![pradtke](https://avatars.githubusercontent.com/u/932934?v=4)](https://github.com/pradtke "pradtke (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fullfatthings-samesiteexceptions/health.svg)

```
[![Health](https://phpackages.com/badges/fullfatthings-samesiteexceptions/health.svg)](https://phpackages.com/packages/fullfatthings-samesiteexceptions)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
