I'm a htb noob and I had an accidental xsrf attempt while logging in.

I went to the login page for htb, and attempted sign in with my credentials (like I do every single time). The server response came back saying something like “XSRF forgery attempt”. I went back, refreshed the page, and attempted sign in again. The second time it logged me in no problem. Could someone explain why this server error occurred, and how I can prevent it from happening in the future?

Don’t stay idle on the login page or refresh after idling?