Security concern: Session HttpOnly = true
Hello.
OpenCart 3.x and OpenCart 4.x
I recommend setting the session cookie with the HttpOnly attribute enabled (HttpOnly=true). This prevents JavaScript from accessing the session cookie and reduces the risk of client-side attacks.
By default, OpenCart does not require JavaScript access to the session cookie, unless a custom module specifically depends on it.
Enabling HttpOnly helps mitigate the risk of session cookie theft through XSS (Cross-Site Scripting) attacks, which could otherwise allow an attacker to gain unauthorized access to the Admin or Catalog areas.
OpenCart is generally secure by default. However, potential security issues may arise from third-party extensions or custom modules, particularly those that accept user input through form fields or URL parameters without proper validation and sanitization.
For this reason, enabling the HttpOnly attribute on the session cookie serves as an additional layer of protection against session theft via XSS vulnerabilities that may be introduced by such modules.
This is a preventive security measure and is considered a security best practice.
Thank you!
Source: opencart/opencart