Skip to content

Commit 026292f

Browse files
committed
Add directions on how to install
1 parent b284894 commit 026292f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ appcookie__ssn-fallback=value; Secure
2424

2525
When your app receives an incoming request, this package will inspect the cookies and promote any fallback cookies that don't already have a primary counterpart marked as `SameSite=None; Secure`.
2626

27+
## Install
28+
29+
Add the middleware to the top of the [middleware property](https://laravel.com/docs/5.8/middleware#global-middleware) in Laravel so that this is the first middleware for every request entering the application:
30+
31+
```php
32+
protected $middleware = [
33+
\KevinSmith\SameSiteNoneCompat\Laravel\SameSiteNoneMiddleware::class,
34+
// all other middleware...
35+
];
36+
```
37+
38+
Then update `config/session.php` to enable secure cookies and set the `same_site` config to `'none'`. Note that it's important that both attributes are set correctly. Cookies marked as `SameSite=None` that do not specify `Secure` will not work.
39+
40+
To check that it's working as expected, [inspect your cookies with Chrome](https://developers.google.com/web/tools/chrome-devtools/storage/cookies) and look for copies of all your cookies with the added suffix `__ssn-fallback`. And of course, you'll want to test this in all the browsers your audience uses to access your application.
41+
2742
## License
2843

2944
Copyright 2020 Kevin Smith

0 commit comments

Comments
 (0)