Skip to content
Snippets Groups Projects
Unverified Commit 3857cf1f authored by Waheed Ahmed's avatar Waheed Ahmed Committed by GitHub
Browse files

Merge pull request #22722 from edx/waheed/PROD-1107-fix-update-session-lang

Fix update session language endpoint.
parents 0f74e6ce 78dabaf2
No related branches found
No related tags found
No related merge requests found
......@@ -27,11 +27,10 @@ def update_session_language(request):
language = data.get(LANGUAGE_KEY, settings.LANGUAGE_CODE)
if request.session.get(LANGUAGE_SESSION_KEY, None) != language:
request.session[LANGUAGE_SESSION_KEY] = six.text_type(language)
if not is_request_from_mobile_app(request):
response.set_cookie(
settings.LANGUAGE_COOKIE,
language,
domain=settings.SESSION_COOKIE_DOMAIN,
max_age=COOKIE_DURATION
)
response.set_cookie(
settings.LANGUAGE_COOKIE,
language,
domain=settings.SESSION_COOKIE_DOMAIN,
max_age=COOKIE_DURATION
)
return response
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment