Skip to content

Add the SameSite config option to the cookie creation#80

Closed
kingsleyh wants to merge 1 commit intokemalcr:masterfrom
kingsleyh:master
Closed

Add the SameSite config option to the cookie creation#80
kingsleyh wants to merge 1 commit intokemalcr:masterfrom
kingsleyh:master

Conversation

@kingsleyh
Copy link
Copy Markdown

@kingsleyh kingsleyh commented Jan 2, 2020

I needed to secure the cookie with the SameSite configuration option. This PR adds it.

example:

   Kemal::Session.config do |config|
          config.samesite = HTTP::Cookie::SameSite::Strict
      end

The value is either SameSite::Strict or SameSite::Lax as per the existing HTTP::Cookie code in Crystal - if it's left unconfigured then it defaults to nil in the same way domain works

@rdp
Copy link
Copy Markdown
Contributor

rdp commented Jan 19, 2021

Yes please! Perhaps add to documentation? Also for followers note that SameSite::None is not available till crystal > 0.35.1

@sdogruyol
Copy link
Copy Markdown
Member

@kingsleyh thanks for this 🙏 Is there any chance you could rebase / update this?

@kingsleyh
Copy link
Copy Markdown
Author

Wow so long ago hah

@sdogruyol
Copy link
Copy Markdown
Member

Gonna take over this PR 👍

@sdogruyol sdogruyol mentioned this pull request Mar 17, 2021
@sdogruyol
Copy link
Copy Markdown
Member

Closing in favor of #96 . Thanks @kingsleyh 🙏

@sdogruyol sdogruyol closed this Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants