Hello, I would like a simple example about how to set session cookies by the server. Instead of just returning “ok”, I would like the server to also create a “sessionToken” cookie.
I have found this Servant Cookie Doc, but it seems to be complicated without an example.
performLoginServer :: PostgresConnection -> Server PerformLoginProxy
performLoginServer conn (LoginForm username password) = do
userMaybe <- liftIO $ do getUserMaybe conn username password
case userMaybe of
Just user -> return "ok"
Nothing -> throwError $ err401