我無法修改從服務器端存儲在Cookie中的SessionKey的最後一個值。 SessionKey在下一個請求中仍然具有舊值。我的服務器端代碼有什麼問題?C#Cookies(修改/替換問題)
var varHttpListenerContextResponseCookie_SessionKey =
refHttpListenerContext.Response.Cookies[Constants.Cookies.LongNames.SessionKey];
if (varHttpListenerContextResponseCookie_SessionKey != null)
{
varHttpListenerContextResponseCookie_SessionKey.Value = refSessionKey;
}
else
{
refHttpListenerContext.Response.AppendCookie(
new System.Net.Cookie(Constants.Cookies.LongNames.SessionKey, refSessionKey));
}
請幫幫我!:)