https://devhubby.com/thread/how-to-implement-secure-session-management-in-ruby