Michał Perłakowski
Michał Perłakowski

Reputation: 92579

Prevent Yesod from generating client_session_key.aes file

When I launch my Yesod application, it generates a file named client_session_key.aes. I don't need it, because I use sessionless authentication. Can I stop Yesod generating this file?

Upvotes: 5

Views: 339

Answers (2)

Michał Perłakowski
Michał Perłakowski

Reputation: 92579

Yesod documentation says that the makeSessionBackend method by default "uses clientsession with a 2 hour timeout", and that "returning Nothing disables sessions". So the solution is to override that method and return Nothing:

instance Yesod App where
    makeSessionBackend _ = return Nothing

Upvotes: 7

Comment or delete this code from your Foundation.hs file:

makeSessionBackend _ = Just <$> defaultClientSessionBackend
    120    -- timeout in minutes
    "config/client_session_key.aes"

And do stack build.

Upvotes: 0

Related Questions