Skip to content

Commit 7976a59

Browse files
committed
Fix SameSite cookie handling for Python < 3.8
1 parent aa63d12 commit 7976a59

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webware/Cookie.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def setHttpOnly(self, httpOnly=True):
120120
self._cookie['httponly'] = httpOnly
121121

122122
def setSameSite(self, sameSite='Strict'):
123-
self._cookie['samesite'] = sameSite
123+
try:
124+
self._cookie['samesite'] = sameSite
125+
except CookieEngine.CookieError: # Python < 3.8
126+
pass
124127

125128
def setValue(self, value):
126129
self._value = value

0 commit comments

Comments
 (0)