设置超时特定会话 [英] set the timeout for a specific session

查看:123
本文介绍了设置超时特定会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置特定的ASP.NET中的会话超时?有可能的?
我在我的web应用两种或两种以上sesions,我需要设置:

How I can set the timeout for a session specific in ASP.NET? it is possible? I have two or more sesions in my web application, I need set:

Session["foo"] //expire in 14minutes
Session["baa"] //expire in 30minutes

我米想解决这种情况下,如果可能的话不使用的cookies。

I'm wanting solve this case,if possible not using cookies.

在此先感谢!

推荐答案

您可以配置超时在Web.config文件的会话:

You can configure the timeout for a session in the Web.config file:

<configuration>
    <sessionstate mode="inproc"
                  cookieless="true"
                  timeout="14" />
</configuration>

这是默认模式(是InProc)为ASP.NET。正如在他的评论中说rockinthesixtring,你不能配置会话中的单个对象,只是会作为一个整体超时

This is the default mode (InProc) for ASP.NET. As rockinthesixtring said in his comment, you can't configure the timeout for individual objects in the session, just the session as a whole.

ASP.NET会话状态概述

这篇关于设置超时特定会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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