NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
http://nancyfx.org
MIT License
7.16k stars 1.47k forks source link

Add SameSite support for NancyCookies #3006

Open 0x414c49 opened 4 years ago

0x414c49 commented 4 years ago

Prerequisites

Description

Nancy Cookies doesn't support SameSite property. This PR adds SameSite property to cookies. The possible values for SameSite property are defined by an enum SameSite.cs: Lax, Strict and None.

This change won't break anything, all cookies work as they suppose to work. All the tests are passed and two new tests added to cover the new functionality.

Fix #3002

drewfreyling commented 4 years ago

Nice work on the pr. I think setting the secure value to true automatically isn't the right approach. That should be user set. Not all browsers are doing the none+secure thing. Even if they were it makes the code more obvious if the user is setting it themselves.

0x414c49 commented 4 years ago

Nice work on the pr. I think setting the secure value to true automatically isn't the right approach. That should be user set. Not all browsers are doing the none+secure thing. Even if they were it makes the code more obvious if the user is setting it themselves.

Kinda agree with you. I will change to codes and push them.