File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 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'
1717Run the migration generator:
1818
1919 rails generate active_record:session_migration
20-
20+
2121Run the migration:
2222
2323 rake db:migrate
@@ -28,6 +28,13 @@ Then, set your session store in `config/initializers/session_store.rb`:
2828Rails .application.config.session_store :active_record_store , :key => ' _my_app_session'
2929```
3030
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+
3138Configuration
3239--------------
3340
You can’t perform that action at this time.
0 commit comments