Closed michalrus closed 6 years ago
Hello again,
I've exported the class, so fell free to use it.
I expected AuthCookieSettings
to be persistent, so (from my point of view) your approach seems a little bit strange. However, if I needed to customize sessions in a way you mentioned in two previous issues, I would do the same trick :)
This is why I'm considering moving "mutable" (i.e. session-specific) options to SessionSettings
, so they can be stored right in the cookies.
So if it's possible to store your options inside cookies (e.g. they do not affect how to decrypt/verify cookies) and they are of general purpose (might be useful for any application, not a specific one), I can add them into SessionSettings
.
If they aren't of general purpose, I'll try to consider parametrized SessionSettings
record.
Thank you very much! ♥
Hello!
Could you export
CookiedWrapperClass
? Or define it in an*.Internal
module.Use case: I need to derive
AuthCookieSettings
from some data received in the request. I’m defining my owncookied'
similarly to:The problem is obviously, that GHC is complaining about missing top-level signatures, and I can’t add one, because that
CookiedWrapperClass
class is not exported.ExtractDatum
is a Servant combinator, that extracts some data fromNetwork.Wai.Request
—that part is irrelevant.And then using it like:
If you know of a better way to achieve that use case (depending on some value from
Network.Wai.Request
inAuthCookieSettings
in all three places:cookied
,addSession
,removeSession
), then I’ll happily switch to that solution!