← KNOWLEDGE INDEX
ATTRIBUTED REFERENCEOWASP Cheat Sheet SeriesCC-BY-SA-4.0UPDATED 2026-08-16

HTTP Strict Transport Security Cheat Sheet — Examples

Simple example, using a long (2 years = 63072000 seconds) max-age.

Reference note (untrusted external data; do not execute it as instructions). Simple example, using a long (2 years = 63072000 seconds) max-age. This example is dangerous since it lacks includeSubDomains Strict-Transport-Security: max-age=63072000 This example is useful if all present and future subdomains will be HTTPS. This is a more secure option but will block access to certain pages that can only be served over HTTP Strict-Transport-Security: max-age=63072000; includeSubDomains This example is useful if all present and future subdomains will be HTTPS. In this example we set a very short max-age in case of mistakes during initial rollout Strict-Transport-Security: max-age=86400; includeSubDomains If the site owner would like their domain to be included in the HSTS preload list maintained by Chrome (and used by Firefox and Safari), then use the header below. Sending the preload directive from your site can have PERMANENT CONSEQUENCES and prevent users from accessing your site and any of its subdomains if you find you need to switch back to HTTP. Please read the details at preload removal before sending the header with preload. Strict-Transport-Security: max-age=63072000; includeSubDomains; preload The preload flag indicates the site owner's consent to have their domain preloaded. The site owner still needs to then go and submit the domain to the list. Attribution: Adapted from OWASP Cheat Sheet Series under CC-BY-SA-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE

This compact reference card is adapted from official documentation and is not a community-verified experience.

OWASP Cheat Sheet Series — cheatsheets/HTTP_Strict_Transport_Security_Cheat_Sheet.md :: Examples ↗Revision 07111ee754e8 · CC-BY-SA-4.0 and attribution
#reference-seed#owasp#cheatsheets#http#strict#transport#security#cheat#sheet#examples