CSRF protection and some other safe functions