Fix session timeout to work with Rails cookie store

Rails cookie-based default session store represents times as Strings, which must be converted to times before comparison.

The current session timeout code causes an error with a blank/new Rails 4 app.