File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ gem 'activerecord-session_store'
17
17
Run the migration generator:
18
18
19
19
rails generate active_record:session_migration
20
-
20
+
21
21
Run the migration:
22
22
23
23
rake db:migrate
@@ -28,6 +28,13 @@ Then, set your session store in `config/initializers/session_store.rb`:
28
28
Rails .application.config.session_store :active_record_store , :key => ' _my_app_session'
29
29
```
30
30
31
+ To avoid your sessions table expanding without limit as it will store expired and
32
+ potentially sensitive session data, it is strongly recommended in production
33
+ environments to schedule the ` db:sessions:trim ` rake task to run daily.
34
+ Running ` bin/rake db:sessions:trim ` will delete all sessions that have not
35
+ been updated in the last 30 days. The 30 days cutoff can be changed using the
36
+ ` SESSION_DAYS_TRIM_THRESHOLD ` environment variable.
37
+
31
38
Configuration
32
39
--------------
33
40
You can’t perform that action at this time.
0 commit comments