Generate and check tokens to protect against CSRF attacks
