Skip to content

Commit

Permalink
Expose more optional parameters for setting web session
Browse files Browse the repository at this point in the history
  • Loading branch information
Favo02 committed Apr 19, 2024
1 parent d1250a2 commit d3ded5e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sihl/src/web_session.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ let get_all
let set
?(cookie_key = "_session")
?(secret = Core_configuration.read_secret ())
?(expires = `Session)
?(scope = Uri.of_string "/")
?(same_site = `Lax)
?(secure = false)
?(http_only = false)
session
resp
=
Expand All @@ -71,7 +76,11 @@ let set
let cookie_value = Session.to_json session in
let cookie = cookie_key, cookie_value in
Opium.Response.add_cookie_or_replace
~scope:(Uri.of_string "/")
~expires:expires
~scope:scope
~same_site:same_site
~secure:secure
~http_only:http_only
~sign_with:signed_with
cookie
resp
Expand Down

0 comments on commit d3ded5e

Please sign in to comment.