use to_hash on the request.session object for rails 4.x compatibility