Merge pull request #11257 from scmmishra/same-site-mobile

feat: set samesite none for mobile
This commit is contained in:
mergify[bot] 2020-08-13 12:37:46 +00:00 committed by GitHub
commit fbb3d6b88e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -340,6 +340,11 @@ class CookieManager:
def set_cookie(self, key, value, expires=None, secure=False, httponly=False, samesite="Lax"):
if not secure and hasattr(frappe.local, 'request'):
secure = frappe.local.request.scheme == "https"
# Cordova does not work with Lax
if frappe.local.session.data.device == "mobile":
samesite = None
self.cookies[key] = {
"value": value,
"expires": expires,