Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

default session expiry issue on Rails

I have an application running in production mode. After a while, the session data seems to clear out. Currently I am using vanilla Rails 7.1.1.
What could be causing this? I want session data to stick around as long as possible.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This would set the session cookie to expire automatically 14 days after creation.

Rails.application.config.session_store :cookie_store, expire_after: 14.days

You can check the documentation

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading