MCPcopy
hub / github.com/django/django / rotate_token

Function rotate_token

django/middleware/csrf.py:117–122  ·  view source on GitHub ↗

Change the CSRF token in use for a request - should be done on login for security purposes.

(request)

Source from the content-addressed store, hash-verified

115
116
117def rotate_token(request):
118 """
119 Change the CSRF token in use for a request - should be done on login
120 for security purposes.
121 """
122 _add_new_csrf_cookie(request)
123
124
125class InvalidTokenFormat(Exception):

Callers 4

loginFunction · 0.90
aloginFunction · 0.90
test_rotate_tokenMethod · 0.90
process_responseMethod · 0.90

Calls 1

_add_new_csrf_cookieFunction · 0.85

Tested by 1

test_rotate_tokenMethod · 0.72