开发者

session in asp.net?

开发者 https://www.devze.com 2023-01-21 15:16 出处:网络
I am facing a problem. I maintain a session after login like session[\"Us开发者_如何转开发erID\"] and every page is locked with this session like

I am facing a problem.

I maintain a session after login like session["Us开发者_如何转开发erID"] and every page is locked with this session like

if(session["UserID"] == "")
{
Response.redirect("./loginpage.aspx");
}
else
{
// page working code
}

Problem is that i am saving the data then redirect the page after saving session was automatically clear and the page is redirect to login page.

in web config file i write this line

<sessionState mode="InProc"  timeout="60">

how i solved this problem to stay in session state on save data and redirecting the same page.


you can use a Session.Abandon() call before redirecting to loginpage.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号