Skip to content

Releases: zerodha/simplesessions

v3.0.0

01 Jun 09:00
Compare
Choose a tag to compare

What's Changed

  • Store API Changes

    • The Store no longer generates the session ID; it is now passed on to the Create() method.
    • Introduced a new method, SetMulti(), to set key-value pairs.
    • The Commit() method has been removed. Both Set() and SetMulti() methods now apply changes immediately to the store.
    • The Clear() method now only empties the session.
    • A new method, Destroy(), has been added to delete the session.
  • Session Manager API Changes

    • Cookie-related options have been moved to Options.Cookie.
    • The RegisterSetCookie and RegisterGetCookie methods have been removed and replaced with SetCookieHooks, which takes get and set cookie callbacks respectively.
    • The Options.DisableAutoSet option has been removed and replaced with Options.EnableAutoCreate. A new session will not be created automatically unless Options.EnableAutoCreate is set to true.
    • Added a new method, manager.NewSession(), to create a new session. Since sessions are not created automatically on Acquire() if Options.EnableAutoCreate is not set to true.
    • The Acquire() method now takes context as the first parameter instead of the last.
    • Introduced a new method, SetCookieHooks, which can be used to override session ID generation and validation. By default, a 32-character alphanumeric ID is generated, and the length can be changed using Options.SessionIDLength.
  • Session API Changes

    • Removed the ErrorFieldNotFound error. The store returns a nil value if a field is not found. If chained with type assertion helpers, then ErrNil will be raised when the value is nil.
    • The LoadValues() and ResetValues() methods have been removed and replaced with Cache() and ResetCache() methods. Unlike the previous version, all mutations are saved in the cache if Cache() is called.
    • The Clear() method no longer clears the cookie and only empties the session. Use the new Destroy() method to delete the session and clear the cookie.

Full Changelog: v2.0.1...v3.0.0

Release - v0.2.0

04 Feb 14:28
7c19a70
Compare
Choose a tag to compare
  • New Reds store called goredis which used Go-redis lib.
  • New conv package to avoid duplicate implementation of type conversion helpers in store.
  • Upgraded min go version to 1.14 from 1.13 and dropped CI testing for 1.12 and added 1.15.

Release - v0.1.1

21 Jan 06:59
4427728
Compare
Choose a tag to compare

Release - v0.1.0

04 Sep 09:16
9343b4f
Compare
Choose a tag to compare
  • Added support for cookie.SameSite (#9)
  • Support for setting securecookie name (#8)
  • Method to get session ID (ba6acd5)

Method to create session manually

24 Feb 16:20
Compare
Choose a tag to compare

Added session.Create method to manually create a new session. This can be used when DisableAutoSet is set to true.

Initial release - v0.0.1

05 Sep 09:35
64bb245
Compare
Choose a tag to compare
Merge pull request #5 from vividvilla/gomodules

feat: convert package as go module