Skip to main content

rotate_token

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

def rotate_token(
request: HttpRequest
) - > null

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

Parameters

NameTypeDescription
requestHttpRequestThe current request object which will be updated with a new CSRF cookie.

Returns

TypeDescription
nullNothing is returned; the function modifies the request state and sets a new cookie.