Skip to content

Commit 863bf1b

Browse files
committed
Fixed cookie problems in the ResourceHandler examples on Linux (Issue 127).
1 parent 074d3e5 commit 863bf1b

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

cefpython/cef3/linux/binaries_32bit/wxpython-response.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,12 @@ def ProcessRequest(self, request, callback):
141141
self._responseHeadersReadyCallback = callback
142142
self._webRequestClient = WebRequestClient()
143143
self._webRequestClient._resourceHandler = self
144-
# To skip cache:
145-
# | request.SetFlags(cefpython.Request.Flags["SkipCache"])
146-
# Must keep a strong reference to the WebRequest() object.
144+
# Need to set AllowCacheCredentials and AllowCookies for
145+
# the cookies to work during POST requests (Issue 127).
146+
# To skip cache set the SkipCache request flag.
147+
request.SetFlags(cefpython.Request.Flags["AllowCachedCredentials"]\
148+
| cefpython.Request.Flags["AllowCookies"])
149+
# A strong reference to the WebRequest object must kept.
147150
self._webRequest = cefpython.WebRequest.Create(
148151
request, self._webRequestClient)
149152
return True

cefpython/cef3/linux/binaries_64bit/wxpython-response.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,12 @@ def ProcessRequest(self, request, callback):
141141
self._responseHeadersReadyCallback = callback
142142
self._webRequestClient = WebRequestClient()
143143
self._webRequestClient._resourceHandler = self
144-
# To skip cache:
145-
# | request.SetFlags(cefpython.Request.Flags["SkipCache"])
146-
# Must keep a strong reference to the WebRequest() object.
144+
# Need to set AllowCacheCredentials and AllowCookies for
145+
# the cookies to work during POST requests (Issue 127).
146+
# To skip cache set the SkipCache request flag.
147+
request.SetFlags(cefpython.Request.Flags["AllowCachedCredentials"]\
148+
| cefpython.Request.Flags["AllowCookies"])
149+
# A strong reference to the WebRequest object must kept.
147150
self._webRequest = cefpython.WebRequest.Create(
148151
request, self._webRequestClient)
149152
return True

0 commit comments

Comments
 (0)