SameSite cookies in ASP.NET 4.0

Viewed 3646

I have an application written in ASP.NET 4.0. All was working fine till google chrome introduced this samesite cookie default value to 'lex'.

There is a solution of handling samesite cookie in asp.net version 4.7.2.

https://docs.microsoft.com/en-us/aspnet/samesite/system-web-samesite

But I am unable to find any solution for version 4.0. Do I need to upgrade from 4.0 to 4.7.2 ?

3 Answers

This also works before 4.7.2:

Response.Headers.Add("set-cookie", "mysessioncookie=theValue; path=/; SameSite=Strict")

Related