Session info is lost in Chrome (but works in other browsers) Session info is lost in Chrome (but works in other browsers) google-chrome google-chrome

Session info is lost in Chrome (but works in other browsers)


I had similar issue: cookies has been cleared (sometimes, not always) short time after page rendered. Reason was multiply calling internal API during page rendering, which had session_start(); inside.

Removing session_start() from API solved problem.

Problem has been with Chrome and Firefox, Safari worked without problem.


It could be a cross domain issue.try to use sameSite option config for the cookie on the append :

   var cookieOptions = new CookieOptions            {                HttpOnly = true,                Secure = true,                Expires = DateTime.UtcNow.AddDays(7),                SameSite = SameSiteMode.None            };            Response.Cookies.Append("refreshToken", token, cookieOptions);