How to implement a wait page to show using asp.net mvc

I have this in my webconfig file ...

<authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> 

a timeout of 2880 means how many seconds or minutes will it take?

How to show when my session is disconnected, I need to display the SessionTimeout.aspx page ...

thanks

+6
asp.net-mvc
source share
3 answers

You can define session time in MVC with an action filter. Here is the question I asked about the problem. And the time is in minutes. (check comments for link)

+4
source share

As Gabriel said, using FormsAuthentication, a timeout will occur behind the scenes, meaning that your user will be prompted to log back in if they access the page after a while.

I would suggest exploring the addition of slideExpiration = "true" to your web.config.

In addition, you may need to automatically disconnect, so potentially sensitive data will not remain open after a timeout.

I did this by calling window.setTimeout (myFunction, 30000) with each page load if the user was authenticated. This function uses jQuery ajax to achieve an action that returns the amount of time remaining before the session expires. Once the amount of time is below zero, you can redirect to the logout action via JavaScript. Otherwise, this method simply calls window.setTimeout (myFunction, 30000) to keep checking.

You can get a fancier by adding a warning message and letting the user click a button that uses jQuery ajax to click on an action that resets the timer.

+1
source share

Make a counter in javascript, and when the timeout is reached, redirect the user.

Edit: As I understand your question, did you want to redirect to the page when the user has been inactive for too long?

-one
source share

All Articles