Skip to content

Commit

Permalink
Merge pull request #82 from uw-it-aca/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mikeseibel authored Sep 2, 2020
2 parents c3b9f3a + 5bd35e2 commit 5dcb452
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions blti/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ def process_request(self, request):
if session_id is not None:
session_key = settings.SESSION_COOKIE_NAME
request.COOKIES[session_key] = session_id


class SameSiteMiddleware(MiddlewareMixin):
def process_response(self, request, response):
if 'sessionid' in response.cookies:
response.cookies['sessionid']['samesite'] = 'None'
if 'csrftoken' in response.cookies:
response.cookies['csrftoken']['samesite'] = 'None'
return response

0 comments on commit 5dcb452

Please sign in to comment.