Description
Suave implements cookie session. See SuaveIO Example/Program.fs
path "/session"
>=> statefulForSession // Session.State.CookieStateStore
>=> context (fun x ->
match HttpContext.state x with
| None ->
// restarted server without keeping the key; set key manually?
let msg = "Server Key, Cookie Serialiser reset, or Cookie Data Corrupt, "
+ "if you refresh the browser page, you'll have gotten a new cookie."
OK msg
| Some store ->
match store.get "counter" with
| Some y ->
store.set "counter" (y + 1)
>=> OK (sprintf "Hello %d time(s)" (y + 1) )
| None ->
store.set "counter" 1
>=> OK "First time")
While Giraffe implements functionality more in line with asp.net core: Giraffe/Auth.fs
Description
Suave implements cookie session. See SuaveIO Example/Program.fs
While Giraffe implements functionality more in line with asp.net core: Giraffe/Auth.fs