Timeout option for Simplemembership

a 夏天 提交于 2019-12-24 15:48:02

问题


Does simplemembership have an easy way to set a timeout to automatically log you out after a certain amount of time has passed while you've been inactive?


回答1:


SimpleMembership doesn't provide a timeout you can configure, the authentication mechanism does.

If you are using FormsAuthentication, you can setup this timeout here:

<authentication mode="Forms">
  <forms loginUrl="~/Login" timeout="20" slidingExpiration="true" />
</authentication>

In the example above the timeout is set to 20 minutes. This means that the authentication cookie (containing the authentication ticket) will expire after 20 minutes of inactivity once the user is authenticated.

The membership provider is responsible to validate the user credentials, among other responsibilities. However it is not responsible of "recognizing" subsequent request for authenticated users.

Please check this article so you have a better idea about what is happening behind the scene.



来源:https://stackoverflow.com/questions/15980413/timeout-option-for-simplemembership

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!