Project

General

Profile

Actions

Patch #9118

closed

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

Added by Jérémy Lal over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Rails support
Target version:
-
Start date:
2011-08-24
Due date:
% Done:

0%

Estimated time:

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


Files

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

Related issues

Has duplicate Redmine - Defect #9840: Can't log out of 1.3.0 without errorClosed

Actions
Actions

Also available in: Atom PDF