Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
c1bc605a
Commit
c1bc605a
authored
Jan 16, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: allow instances to surchage the SameSite value
parent
8c65094a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
2 deletions
+73
-2
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/ERP5Site_getSameSite.py
...tem/portal_skins/erp5_auto_logout/ERP5Site_getSameSite.py
+1
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/ERP5Site_getSameSite.xml
...em/portal_skins/erp5_auto_logout/ERP5Site_getSameSite.xml
+62
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/setAuthCookie.py
...mplateItem/portal_skins/erp5_auto_logout/setAuthCookie.py
+10
-2
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/ERP5Site_getSameSite.py
0 → 100644
View file @
c1bc605a
return
'Lax'
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/ERP5Site_getSameSite.xml
0 → 100644
View file @
c1bc605a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
host=None, port=None, path=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_getSameSite
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/setAuthCookie.py
View file @
c1bc605a
...
...
@@ -15,12 +15,20 @@ portal.portal_sessions[
)
)
][
'ac_renew'
]
=
ac_renew
REQUEST_DICT
=
getattr
(
portal
,
'REQUEST'
,
{})
same_site
=
portal
.
ERP5Site_getSameSite
(
host
=
REQUEST_DICT
.
get
(
'HTTP_HOST'
,
None
))
if
same_site
not
in
(
'None'
,
'Lax'
,
'Strict'
):
# Do not use the SameSite attribute
same_site
=
None
resp
.
setCookie
(
name
=
cookie_name
,
value
=
cookie_value
,
path
=
'/'
,
secure
=
getattr
(
portal
,
'REQUEST'
,
{})
.
get
(
'SERVER_URL'
,
''
).
startswith
(
'https:'
),
secure
=
REQUEST_DICT
.
get
(
'SERVER_URL'
,
''
).
startswith
(
'https:'
),
http_only
=
True
,
same_site
=
'Lax'
,
same_site
=
same_site
,
**
kw
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment