只有在30分钟没有活动时才会发生超时 [英] Timeout should only occur if no activity for 30 minutes

查看:105
本文介绍了只有在30分钟没有活动时才会发生超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,



积极在系统中工作时,用户不应该超时。只有在没有30分钟的活动时才会发生超时。



项目是用MVC Razor环境开发的。你可以帮我解决。



等待你的快速回复。



谢谢,

Sayed。



我尝试了什么:



在web.config文件中我试过使用此代码,但在用户在网站上处于活动状态(发出请求)后30分钟会话到期。 

1.第一次

< sessionState mode =InProcregenerateExpiredSessionId =truetimeout =30/>

2.秒时间

< sessionState mode =InProctimeout =30/>

你能看一下这个并向我提供你的解决方案。

解决方案

也许你的web.config有错误(例如,sessionState节点不在system.web节点内)?或者其他地方的代码中设置了值?由于我通常会根据角色设置会话超时,因此我会在会话的启动事件期间在Global.asax文件中设置超时。也许尝试在那里设置值? ie

  void  Session_Start( object  sender ,EventArgs e)
{
System.Web.HttpContext.Current.Session.Timeout = 60 ; // 60分钟
}


Hi Team,

When actively working in the system the User should not timeout. Timeout should only occur if no activity for 30 minutes.

the project is developed with MVC Razor environment.Can you help me out.

Waiting for your prompt reply.

Thanks,
Sayed.

What I have tried:

In web.config file I have tried using this code but after 30 minutes session expired while user is active(making request) on web site.

1. first time

<sessionState mode="InProc" regenerateExpiredSessionId="true" timeout="30" />

2.second time

<sessionState mode="InProc" timeout="30" />

can you please look on this and provide me your solution.

解决方案

Perhaps your web.config has an error (e.g. sessionState node is not inside the system.web node)? Or value is being set in code elsewhere? Since I typically have session time-outs based on role, I set timeouts in the Global.asax file during the session's start event. Maybe try and set the value there? i.e.

void Session_Start(object sender, EventArgs e)
{
    System.Web.HttpContext.Current.Session.Timeout = 60; // sixty minutes
}


这篇关于只有在30分钟没有活动时才会发生超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆