Patch #9118

rack 1.3.1 "cookies.delete :autologin" raise NoMethodError on Symbol

Added by Jérémy Lal over 6 years ago. Updated almost 6 years ago.

Status:ClosedStart date:2011-08-24
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Rails support
Target version:-

Description

Running redmine 1.1.3 or 1.2.1 with rack 1.3.1, i get on logout :

NoMethodError in AccountController#logout

private method `gsub' called for :autologin:Symbol
RAILS_ROOT: /usr/share/redmine

Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/vendor_ruby/rack/backports/uri/common.rb:24:in `encode_www_form_component'
/usr/lib/ruby/vendor_ruby/rack/utils.rb:23:in `escape'
/usr/lib/ruby/vendor_ruby/rack/utils.rb:201:in `set_cookie_header!'
/usr/lib/ruby/vendor_ruby/rack/utils.rb:238:in `delete_cookie_header!'
/usr/lib/ruby/vendor_ruby/rack/response.rb:63:in `delete_cookie'
/usr/lib/ruby/vendor_ruby/action_controller/cookies.rb:94:in `delete'
/usr/share/redmine/app/controllers/account_controller.rb:132:in `logout_user'
/usr/share/redmine/app/controllers/account_controller.rb:36:in `logout'

A simple way to fix this is :

--- app/controllers/account_controller.rb.orig    2011-08-24 11:41:33.000000000 -0300
+++ app/controllers/account_controller.rb    2011-08-24 09:21:00.000000000 -0300
@@ -129,7 +129,7 @@

   def logout_user
     if User.current.logged?
-      cookies.delete :autologin
+      cookies.delete :autologin.to_s
       Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
       self.logged_user = nil
     end

1013_cookie_symbol_to_s.patch Magnifier (1.09 KB) Jérémy Lal, 2011-09-13 00:11


Related issues

Duplicated by Redmine - Defect #9840: Can't log out of 1.3.0 without error Closed

History

#1 Updated by Marc Dequènes over 6 years ago

I encountered this issue and this patch fixed it.

#2 Updated by Derek Chen-Becker over 6 years ago

I have the same issue. Patch fixed it

#3 Updated by Jérémy Lal over 6 years ago

A more complete patch here.

#5 Updated by Etienne Massip almost 6 years ago

  • Status changed from New to Closed

Should have been fixed with Rack v1.4.0, released on December, 28.

Also available in: Atom PDF