SameSite cookies with Apache
Pete Freitag
Posted on April 1, 2020
Almost two years ago I wrote about how you can enable SameSite cookies with IIS on cookies that do not have the ability to be written as SameSite. Today I was helping a client on Apache do the same thing, here's how we can add SameSite=lax
to a JSESSIONID
cookie for example:
Header edit Set-Cookie ^(JSESSIONID.\*)$ $1;SameSite=lax
But suppose you just wanted to make all cookies set by your web app SameSite, you can just do this:
Header edit Set-Cookie ^(.\*)$ $1;SameSite=lax
This works by appending ;SameSite=lax
to the end of all Set-Cookie
http response headers.
💖 💪 🙅 🚩
Pete Freitag
Posted on April 1, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
undefined 🌐 The Tech Revolution No One's Talking About: How Citizen Developers 🛠️ Are Eating Silicon Valley's Lunch 💼🍽️
November 29, 2024