Web应用程序自动注销 [英] Web application getting logged out automatically
问题描述
即使我只是打开某些页面并登录,我也会一直重定向到登录页面,就像我已经注销一样.
我使用会话来跟踪登录.如果会话值是null,则将其重定向到主页.我总是将会话值设置为null,从而将其重定向到登录页面.
有没有人知道如何解决此问题?
I keep getting redirected to login page as if i had been logged out even if I just open some page and login.
I have used sessions to keep track of login. If the session value is null I redirect it to the main page. I always get the session value null and thus redirected to login page.
Does anyone have any idea of how to solve this issue?
推荐答案
任何机构都没有解决问题的想法吗?
does any body have any idea how to solve dis matter???
没有相关的代码将无济于事.
您可以调试代码并检查:在用户输入有效的用户名和密码之后,是否正确创建了Session.
Would not be able to help much without the relevant code.
You may debug the code and check: after the user enters valid user id and password, Session is created properly or not.
将应用程序发布到虚拟主机后,我也遇到了类似的问题. br/>
在Web.Config下尝试使用system.web/machineKey元素:
Once I published my application to the webhosting I had similar problem.
Experiment with system.web/machineKey element under Web.Config:
<system.web>
<machineKey validationKey="E2..." decryptionKey="3C..." validation="SHA1" decryption="AES" />
</system.web>
这篇关于Web应用程序自动注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!