Skip to content

Bad Save() implementation #4

Description

@janekolszak

Hi,
Great package, thank you soo much for providing this!

I see that Save(...) implementation relies on the value of session.Options.MaxAge
This is prone to race conditions since Options is a pointer. Several goroutines will be changing the same sessions.Options object.

The best solution I see (and is partially implemented) is to:

  • add Expiration field to the data saved in RethinkDB
  • remove conditional deletion of the data saved in RethinkDB

User will have to run periodical cleanup, but it shouldn't be a problem.

Do I have a green light? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions