Project

General

Profile

Actions

Defect #43164

closed

Deleting role that used by many projects raises CookieOverflow error

Added by Kenta Kumojima 4 days ago. Updated about 23 hours ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Administration
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Deleting role that used by many projects (in my environment, it is used in 30 projects) raises ActionDispatch::Cookies::CookieOverflow.
The flash message is too long to store session.

# app/controllers/roles_controller.rb
def destroy
...
   flash[:error] += l(:error_can_not_remove_role_reason_members_html, projects: links)
...
end

ActionDispatch::Cookies::CookieOverflow (_redmine_session cookie overflowed with size 4206 bytes):

actionpack (7.2.2.2) lib/action_dispatch/middleware/cookies.rb:612:in `check_for_overflow!'
actionpack (7.2.2.2) lib/action_dispatch/middleware/cookies.rb:694:in `commit'
actionpack (7.2.2.2) lib/action_dispatch/middleware/cookies.rb:530:in `[]='
actionpack (7.2.2.2) lib/action_dispatch/middleware/session/cookie_store.rb:117:in `set_cookie'
...

It is better to use flash.now instead of flash.


Files

fix_destroy_role.patch (2.22 KB) fix_destroy_role.patch Kenta Kumojima, 2025-08-27 11:11

Related issues

Related to Redmine - Feature #42441: Improve error message on role deletion by listing projects using the roleClosedGo MAEDA

Actions
Related to Redmine - Defect #43174: CookieOverflow error when deleting a tracker used by many projectsNew

Actions
Actions #1

Updated by Go MAEDA 2 days ago

  • Status changed from New to Confirmed
  • Target version set to 6.1.0

Thank you for posting the fix. I will commit this fix as a part of #42441.

Actions #2

Updated by Go MAEDA 2 days ago

  • Target version deleted (6.1.0)
Actions #3

Updated by Go MAEDA about 23 hours ago

  • Related to Feature #42441: Improve error message on role deletion by listing projects using the role added
Actions #4

Updated by Go MAEDA about 23 hours ago

  • Status changed from Confirmed to Closed
  • Resolution set to Fixed

Committed the fix in r23933, as a part of #42441. Thank you for your contribution.

Actions #5

Updated by Go MAEDA about 23 hours ago

  • Related to Defect #43174: CookieOverflow error when deleting a tracker used by many projects added
Actions

Also available in: Atom PDF