showing session data with exception notification

June 15, 2009 written by Surendra Singhi .

We have been using Exception Notification in many of our Rails Project. After upgrading to Rails 2.3 and using our own version of optimized session class, we have noticed that the error emails generated by this plugin were not sending session information. To fix this the below patch can be used.

  1. Index: vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml
  2. ===================================================================
  3. — vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml
  4. +++ vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml       (working copy)
  5. @@ -1,2 +1,2 @@
  6. -*session id: <%= @request.session.instance_variable_get(:@session_id).inspect %>
  7. -*data: <%= PP.pp(@request.session.instance_variable_get(:@data), "").gsub(/\n/, "\n  ").strip %>
  8. +*session id: <%= @request.session_options[:id].inspect %>
  9. +*data: <%= @request.session.to_hash.inspect.to_s.gsub(/\n/, "\n  ").strip %>

Tags: , , ,

Leave a Reply