scotty-web / scotty

Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository)
http://hackage.haskell.org/package/scotty
BSD 3-Clause "New" or "Revised" License
1.72k stars 134 forks source link

Implement user sessions #317

Open ocramz opened 1 year ago

ocramz commented 1 year ago

(as already mentioned in the urlshortener example program)

With cookies #69 and a proper exception system in place #310 it should be possible (and fairly easy) to implement a "session" interface like Flask and similar have:

https://testdriven.io/blog/flask-sessions/

See also #59

ocramz commented 11 months ago

code from here could be recycled for this purpose : https://hackage.haskell.org/package/scotty-session-0.0.5/docs/Web-Scotty-Session.html#t:ScottySM

but using scotty internal cookie functions

k0001 commented 6 months ago

I just published wai-cryptocookie, a small wai library that maybe could be used to implement this.

https://hackage.haskell.org/package/wai-cryptocookie/docs/Wai-CryptoCookie.html

The library doesn't depend on anything other than what scotty already depends on.