mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 18:24:03 +00:00
Improved Documentation Search (#61)
* chore: (Improve documentation search for V3) * fix: checks for mispelled words * fix: mispelled words * fix spaces and syntax * Update multi-database-tenancy.blade.md Co-authored-by: Samuel Stancl <samuel.stancl@gmail.com>
This commit is contained in:
parent
0549607899
commit
a4645b3abd
42 changed files with 158 additions and 158 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue