Skip to content

Commit 4952a27

Browse files
committed
Add session specific redis cache
1 parent 4964d29 commit 4952a27

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1010

1111
### Changed
1212
* Panel now throws proper 504: Gateway Timeout errors on server listing when daemon is offline.
13+
* Sessions handled through redis now use a seperate database (default `1`) to store session database to avoid logging users out when flushing the cache.
1314

1415
## v0.7.5 (Derelict Dermodactylus)
1516
### Fixed

config/cache.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
'driver' => 'redis',
7171
'connection' => 'default',
7272
],
73+
74+
'sessions' => [
75+
'driver' => env('SESSION_DRIVER', 'database'),
76+
'table' => 'sessions',
77+
'connection' => env('SESSION_DRIVER') === 'redis' ? 'sessions' : null,
78+
],
7379
],
7480

7581
/*

config/database.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,19 @@
7171

7272
'redis' => [
7373
'client' => 'predis',
74+
7475
'default' => [
7576
'host' => env('REDIS_HOST', 'localhost'),
7677
'password' => env('REDIS_PASSWORD', null),
7778
'port' => env('REDIS_PORT', 6379),
7879
'database' => env('REDIS_DATBASE', 0),
7980
],
81+
82+
'sessions' => [
83+
'host' => env('REDIS_HOST', 'localhost'),
84+
'password' => env('REDIS_PASSWORD', null),
85+
'port' => env('REDIS_PORT', 6379),
86+
'database' => env('REDIS_DATBASE_SESSIONS', 1),
87+
],
8088
],
8189
];

config/session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
|
7070
*/
7171

72-
'connection' => null,
72+
'connection' => env('SESSION_DRIVER') === 'redis' ? 'sessions' : null,
7373

7474
/*
7575
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)