how to extend session timed out with jquery ajax

坚强是说给别人听的谎言 提交于 2019-12-24 14:04:53

问题


I have a web page with a editable jquery grid on it. I am using it with asp.net web form. The web form authentication is set to timeout after 20 minutes. Sometimes, users need to update large number of data on the grid and once they click Save, the website often already timeout and user loses the data.

I am wondering whilst user is still active on the grid, can we trigger something in javascript to prevent web form authentication timeout and server sessions timeout?

Thanks


回答1:


check the link jQuery Timer. You can create a timer in jQuery. If your default time out is 20 min, set the timer to call a ajax call to the server after 15~18 min. This call will do nothing. But as soon as you make the ajax call it will set the session active for another 20 min. So, this way you will be able to keep the session live as long as the user uploads data to the grid.



来源:https://stackoverflow.com/questions/16033115/how-to-extend-session-timed-out-with-jquery-ajax

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