Hi @Wojciech Rajchel
First of all, the first point: since there is no cookie, then we write a cookie.
HttpCookie aCookie = new HttpCookie("cookie1");
aCookie.Value = "";
aCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(aCookie);
Next, if you want all pages below your site to access this cookie. This is called the scope of the cookie, and you can set it like this:
HttpCookie aCookie = new HttpCookie("cookie1");
aCookie .Value = "written " + DateTime.Now.ToString();
aCookie .Expires = DateTime.Now.AddDays(1);
aCookie .Path = "/";
Response.Cookies.Add(aCookie );
Best Regards
Qi You
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.