user922592
user922592

Reputation:

After Rails 4 upgrade session info cutoff

I recently upgraded an app from rails 3.2 to rails 4. I'm having an issue with exception emails, mostly around the session info no longer gives a full detail

Rails 3.2:

-------------------------------
Session:
-------------------------------

  * session id: [FILTERED]
  * data: {"session_id"=>"f95f527ce9b8829396863e755adf4087",
   "_csrf_token"=>"Gr4dGdPtoEPN/1gQ4mzzqpTv45D9vErwIuc28Z/q2Ww=",
   "user_credentials"=>
    "0a1ed7c0e02c01c01c11a1d7f997029d644f97dfdcad5a891b89674313eb439b89bc17b2e97236a50c1e5e1533a9ad99b650883daeb8ad9163dd049f3f78ec28",
   "user_credentials_id"=>104,
   "return_to"=>"/home/index",
   "two_pair"=>false}  

Rails 4:

-------------------------------
Session:
-------------------------------

  * session id: [FILTERED]
  * data: #<ActionDispatch::Request::Session:0x007ff634e5df80 ...>

How can I get the data to be drilled out?

Upvotes: 0

Views: 16

Answers (1)

Wes Foster
Wes Foster

Reputation: 8900

Use inspect or to_json

# This is your data
# data: #<ActionDispatch::Request::Session:0x007ff634e5df80 ...>

data.inspect  # Lays it all out there for you
data.to_json  # Puts it in json format

# You can also try YAML
data.to_yaml  # In YAML format, very easy to read

View the Handy-dandy Rails Debugging Guide for more tips.

Upvotes: 0

Related Questions