Or maybe I'm doing it wrong, cookies are not being set while redirecting?
still zero doogene () {var req = HttpContext.Current.Request; ... user_cookie.set (userId, loginId); ... httpxx Present. response. Redirect (Reich ["Return Locations"]); } Fixed public zero set (long user id, long login id) {var cookies = html. Present. request. Cookies; Var U = New HTTPQQ ("UserID", User ID.Tostring ()); U.HttpOnly = True; Var l = new HTTPQK ("login id", login id.toString ()); L.HttpOnly = True; Cookies.Add (u); Cookies.Add (L); }
You are adding cookies to Request , You would like to add them to Response . Cookie Collection Instead
Also keep in mind that Response Redirection will cancel the current thread which I have seen that problems have arisen on occasion. response. Redirect (URL, falls) will be redirected without being canceled.
Comments
Post a Comment