~mpldr/sessman

d1d02e0d — Moritz Poldrack 6 months ago
fix scope of cookies being set to subpath
59dd37f2 — Moritz Poldrack 6 months ago
fix race condition with concurrent requests
1c2309c9 — Moritz Poldrack 8 months ago
net/http: don't set cookie multiple times

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~mpldr/sessman
read/write
git@git.sr.ht:~mpldr/sessman

You can also use your local clone with git send-email.

#SessMan

That's just like… your session, man.

— The Dude, probably

Just a quick way to manage your sessions. With type-safety, defaults, and more.

#Usage

Look at the example. Instead of a string, you can use a struct holding multiple values.

#Considerations

  • While necessary cookies are possible without asking under the GDPR, it's generally a good idea to only start a session if there is a need for persistence.
  • The cookie is regenerated on every request by default. This is supposed to make session hijacking at least a bit more difficult.
  • The cookie name is intentionally left generic, to avoid giving leaking information.

#License

© Moritz Poldrack and licensed under the MPL

TL;DR:

  • Share your changes
  • give credit
  • don't blame me if it blows up.