[1.5.x] Rotate CSRF token on login

Backport of 1514f17aa60772f48839130f9a5071b9ffe15213 from master