wikicr/config/cookies.cr
Arthur Poulet e9bb1cbdc0
Some checks failed
continuous-integration/drone/push Build is failing
spike: try to install & migrate to lucky
2021-10-15 18:44:23 +02:00

26 lines
708 B
Crystal

require "./server"
Lucky::Session.configure do |settings|
settings.key = "_kisswiki_session"
end
Lucky::CookieJar.configure do |settings|
settings.on_set = ->(cookie : HTTP::Cookie) {
# If ForceSSLHandler is enabled, only send cookies over HTTPS
cookie.secure(Lucky::ForceSSLHandler.settings.enabled)
# By default, don't allow reading cookies with JavaScript
cookie.http_only(true)
# Restrict cookies to a first-party or same-site context
cookie.samesite(:lax)
# Set all cookies to the root path by default
cookie.path("/")
# You can set other defaults for cookies here. For example:
#
# cookie.expires(1.year.from_now).domain("mydomain.com")
}
end