chore: (Improve documentation search for V3)

This commit is contained in:
Adebayo Ilerioluwa 2020-07-21 18:18:18 +01:00
parent 0549607899
commit ecf4391f94
42 changed files with 156 additions and 156 deletions

View file

@ -4,7 +4,7 @@ extends: _layouts.documentation
section: content
---
# Session scoping
# Session scoping {#session-scoping}
Session scoping is one thing that you might have to deal with yourself.
@ -12,15 +12,15 @@ The issue occurs when you're using multiple tenant domains and databases. Users
Here's how you can prevent this.
## Storing sessions in the database
## Storing sessions in the database {#storing-sessions-in-the-database}
Since the databases are automatically separated, simply using the database as the session driver will make this problem disappear altogether.
## Storing sessions in Redis
## Storing sessions in Redis {storing-sessions-in-redis}
This is the same solution as using the DB session driver. If you use the [`RedisTenancyBootstrapper`]({{ $page->link('tenancy-bootstrappers') }}), your Redis databases will be automatically separated for your tenants, and as such, any sessions stored in those Redis databases will be scoped correctly.
## Using a middleware to prevent session forgery
## Using a middleware to prevent session forgery {#using-a-middleware-to-prevent-session-forgery}
Alternatively, you may use the `Stancl\Tenancy\Middleware\ScopeSessions` middleware on your tenant routes to make sure that any attempts to manipulate the session will result in a 403 unauthorized response.