即使会话在ASP.NET C#中过期,如何获取会话值? [英] How to get session value even if session is expired in ASP.NET C#?

查看:82
本文介绍了即使会话在ASP.NET C#中过期,如何获取会话值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我们假设Session [MyValues] =SomethingInSessionVariable;

我们知道会话变量的默认超时在Asp.Net中是20分钟,所以20分钟后,会话[MyValues]中的价值将会消失。所以我们如何在会议结束20分钟后获得SomethingInSessionVarialbe?



我尝试过的事情:



我想要得到它。尽管如此,我还是面临一些问题。

Hi guys, Let's suppose Session["MyValues"]="SomethingInSessionVariable";
As we know that default timeout of session variable is 20 minutes in Asp.Net, so after 20 minutes, the value, in the Session["MyValues"], is going to vanished. So how do we get "SomethingInSessionVarialbe" after 20 minutes when session is expired?

What I have tried:

I am trying to get it. Still, I'm facing some issues.

推荐答案

你不能,那叫做内存管理。如果在会话过期后可以获得这些数据,则没有过期时间的意思。
you can't, that's called the memory management. If one could get those data after session is expired, there is no meaning of "Expire Time" thing.


这篇关于即使会话在ASP.NET C#中过期,如何获取会话值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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