Skip to content

CookieOverflow exception throw when there are a significant number of users and projects #144

@kamnazir

Description

@kamnazir

Hello,
dashboard saves users options in Redmine cookies(session) per user and project and if the number of users and projects increased, the size of cookie goes beyond 4KB. So the below exception will occur.

ActionDispatch::Cookies::CookieOverflow (ActionDispatch::Cookies::CookieOverflow):

actionpack (5.2.4.2) lib/action_dispatch/middleware/cookies.rb:649:in `commit'
actionpack (5.2.4.2) lib/action_dispatch/middleware/cookies.rb:484:in `[]='
actionpack (5.2.4.2) lib/action_dispatch/middleware/session/cookie_store.rb:116:in `set_cookie'
rack (2.2.2) lib/rack/session/abstract/id.rb:403:in `commit_session'
rack (2.2.2) lib/rack/session/abstract/id.rb:268:in `context'
rack (2.2.2) lib/rack/session/abstract/id.rb:260:in `call'
...

I looked in the code and find these two functions:

  def options_for(board)
    session["dashboard_#{@project.id}_#{User.current.id}_#{board}"] ||= {}
  end

  def save_options_for(options, board)
    session["dashboard_#{@project.id}_#{User.current.id}_#{board}"] = options
  end

Redmine saves all sessions in one key named '_redmine_session' and when the size of this session beyond 4KB, all actions which want to write in session, encounter an error. (like create a new issue)

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions