We ran into cookie overflow errors where the cookie store exceeded its 4000 kb limit and caused page crashes locally - it was a matter of time before this occurs in production.
This solution adds the active record session store gem - it relies on a table called sessions which store your session ids. The session ids are then passed back and forth between server and browser. The devise powered cookie will reference the session id and pull data on every request using it as oppose to storing all data inside the cookie store.
This drastically reduced cookie size from 4000kb+ down to around 50kb.
There is a sessions cleanup task also added which needs to be run manually every 2 weeks to delete expired or unused sessions. Sessions typically expire after 2 weeks. Deleting a session will log out a User.
Added unit tests and documentation to stabilise functionality and future proof.
tackles ticket #129
We ran into cookie overflow errors where the cookie store exceeded its 4000 kb limit and caused page crashes locally - it was a matter of time before this occurs in production.
This solution adds the active record session store gem - it relies on a table called sessions which store your session ids. The session ids are then passed back and forth between server and browser. The devise powered cookie will reference the session id and pull data on every request using it as oppose to storing all data inside the cookie store.
This drastically reduced cookie size from 4000kb+ down to around 50kb.
There is a sessions cleanup task also added which needs to be run manually every 2 weeks to delete expired or unused sessions. Sessions typically expire after 2 weeks. Deleting a session will log out a User.
Added unit tests and documentation to stabilise functionality and future proof.