diff options
| author | xXx-caillou-xXx | 2017-12-18 16:27:00 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-18 16:27:00 +0100 |
| commit | f70bd2eafc2fdac9fa528a3e649db0178c601b41 (patch) | |
| tree | 5bde4b106b3e24a49bdb061c9eca2ecfe68b9bbc /src/tests/samesite_cookies.phpt | |
| parent | 75f876fca7587218fdbad9bd10bbe52825591ccc (diff) | |
Fix cookie encryption
Previously, when a cookie was set with the `httpOnly` flag, it was automatically encrypted, due to a logic flaw. This is now fixed and tested.
Diffstat (limited to 'src/tests/samesite_cookies.phpt')
| -rw-r--r-- | src/tests/samesite_cookies.phpt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tests/samesite_cookies.phpt b/src/tests/samesite_cookies.phpt index 70fe10c..12f3d72 100644 --- a/src/tests/samesite_cookies.phpt +++ b/src/tests/samesite_cookies.phpt | |||
| @@ -16,11 +16,13 @@ EOF; | |||
| 16 | <?php | 16 | <?php |
| 17 | setcookie("super_cookie", "super_value"); | 17 | setcookie("super_cookie", "super_value"); |
| 18 | setcookie("awful_cookie", "awful_value"); | 18 | setcookie("awful_cookie", "awful_value"); |
| 19 | setcookie("not_encrypted", "test_value", 1, "1", "1", false, true); | ||
| 19 | setcookie("nice_cookie", "nice_value", 1, "1", "1", true, true); | 20 | setcookie("nice_cookie", "nice_value", 1, "1", "1", true, true); |
| 20 | 21 | ||
| 21 | $expected = array( | 22 | $expected = array( |
| 22 | 'Set-Cookie: super_cookie=super_value; path=; samesite=Lax', | 23 | 'Set-Cookie: super_cookie=super_value; path=; samesite=Lax', |
| 23 | 'Set-Cookie: awful_cookie=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFyZcYjfEskB0AU0V3%2BvwazcRuU%2Ft6KpcUahvxw%3D; path=; samesite=Strict; HttpOnly', | 24 | 'Set-Cookie: awful_cookie=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFyZcYjfEskB0AU0V3%2BvwazcRuU%2Ft6KpcUahvxw%3D; path=; samesite=Strict; HttpOnly', |
| 25 | 'Set-Cookie: not_encrypted=test_value; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=1; domain=1; HttpOnly', | ||
| 24 | 'Set-Cookie: nice_cookie=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJ8ko%2ByA4y%2Bmw5MGBx8fgc3TWOAvhIu%2BfF%2Bx2g%3D%3D; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=1; samesite=Strict; domain=1; secure; HttpOnly', | 26 | 'Set-Cookie: nice_cookie=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJ8ko%2ByA4y%2Bmw5MGBx8fgc3TWOAvhIu%2BfF%2Bx2g%3D%3D; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=1; samesite=Strict; domain=1; secure; HttpOnly', |
| 25 | ); | 27 | ); |
| 26 | 28 | ||
