Sets a cookie containing the CSRF token. Useful for Single page apps.