Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] payment_sips: prevent clearing the session cookie #72267

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions addons/payment_sips/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ def sips_ipn(self, **post):
return ''

@http.route([
'/payment/sips/dpn'], type='http', auth="none", methods=['POST'], csrf=False)
'/payment/sips/dpn'], type='http', auth="none", methods=['POST'], csrf=False, save_session=False)
def sips_dpn(self, **post):
""" Sips DPN """
""" Sips DPN
The session cookie created by Odoo has not the attribute SameSite. Most of browsers will force this attribute
with the value 'Lax'. After the payment, Sips will perform a POST request on this route. For all these reasons,
the cookie won't be added to the request. As a result, if we want to save the session, the server will create
a new session cookie. Therefore, the previous session and all related information will be lost, so it will lead
to undesirable behaviors. This is the reason why `save_session=False` is needed.
"""
try:
_logger.info('Beginning Sips DPN form_feedback with post data %s', pprint.pformat(post)) # debug
self.sips_validate_data(**post)
Expand Down