Secure attribute tells the browser to only send the cookie if the request is being sent over a secure channel i.e. HTTPS. This will protect the cookie from being passed in unencrypted requests. If the application can be accessed over both HTTP and HTTPS, an attacker could be able to redirect the user to send their cookie as part of non-protected requests. Secure attribute must be set to all session/sensitive cookies.
Reference Link - https://owasp.org/www-project-web-sec...