Skip to content

Avoid logging Session cookie encryptor error: ... by default? #29

Description

@dentarg

Does it makes sense to be able to silence this logging or make it opt-in?

rescue Rack::Session::Encryptor::Error => error
request.env[Rack::RACK_ERRORS].puts "Session cookie encryptor error: #{error.message}"

Maybe behind $VERBOSE as done here?

req.get_header(RACK_ERRORS).puts("Deferring cookie for #{session_id}") if $VERBOSE

Looks like it can log the following variants of Session cookie encryptor error: <message>

  • wrong version
  • Message is invalid
  • invalid message
  • HMAC is invalid

I'm not sure they're useful to always have enabled (in production) as any user can trigger at least Session cookie encryptor error: Message is invalid by sending bogus data in the Cookie header.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions