I am facing an issue related to “safeCookieData.” I am working on a feature that allows me to view user dates, but I’m encountering an error when trying to call the API. Does anyone know how to fix it?

WARNING 28 [openedx.core.djangoapps.safe_sessions.middleware] [user 13] [ip] - SafeCookieData user at initial request ‘3’ does not match user at response time: ‘13’ for request path ‘/api/course_home/dates-funix/course-v1:funix+funx_01+2023_1/13/’.
Session did not change.
Hash of session ID from various sources: parsed_cookie=5cf0a3c8; at_request=5cf0a3c8; at_response=5cf0a3c8
WARNING 28 [openedx.core.djangoapps.safe_sessions.middleware] [user None] [ip] - SafeCookieData deleted session cookie for session None
“GET /api/course_home/dates-funix/course-v1:funix+funx_01+2023_1/13/ HTTP/1.1” 401 0

Thank you.

You may need to use mark_user_change_as_expected.

See edx-platform/ at 7293b3e85a8f575cf4ff08260c1f88fffacd3670 · openedx/edx-platform · GitHub.

Or search edx-platform for uses of mark_user_change_as_expected for examples.