Added CSRF support (adresses #456)