我想使用一個會話,但是當我需要返回它的空值?會話[]保留數據多久?
我的網站從一個登錄名開始,我把用戶名放到一個Session中。
Session["userName"] = login.UserName;
然後網站被重定向到一個新的頁面。
return RedirectToAction("Choice", new { token = token });
後女巫我使用鏈接移動到我的下一頁。
@Html.ActionLink("Download", "Download", new {token = Model.Token})
在哪裏我直接把我的代碼的行動結果的首頁控制器相同的控制器我有我的登錄功能。
@Html.ActionLink("Download", "DownloadFile", new { fileid = item.Key, token = Model.Token, platform = "windows", filename = item.Value }, new {@class = "DownloadLink" })
我在哪裏嘗試再次調用我的會話值。
formMobiApi.GetFile(token, fileid, platform, filename, Session["userName"].ToString(), tasks, taskId, spreadSheetStatus);
這些操作中的任何一個是否在執行任何操作以使我的會話值爲空?
我可以使用這樣的會話嗎?
您的會話如何處理?他們是基於cookie還是inproc?您的web.config中的會話超時值是什麼? –
我無法在我的web.Config中找到任何會話超時,並且我不確定我的會話是基於cookie還是inproc,我將如何檢查? – Pomster