Added CSRF protection support and implemented for both login and register forms