One rule
Treat an auth cookie like a house key. Send it only where needed, hide it from browser JavaScript, and give it an expiry.
The safest default for most college projects is an HttpOnly, Secure cookie with SameSite=Lax and a sensible maxAge.
What flags do
HttpOnly means JavaScript cannot read the cookie using document.cookie. This reduces damage if one page gets an XSS bug.
Secure means the browser sends the cookie only over HTTPS. SameSite controls when the browser sends the cookie during cross-site requests.