如何获取当前会话名称 [英] How to get Current session name

查看:71
本文介绍了如何获取当前会话名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..
我有一个以上的会话使用.
并在其他页面中删除会话.
所以..
如何获取当前会话使用或当前工作会话列表..
不是SessionId ...

Hi..
I have more then one session use.
And Some time remove session in other page.
So..
How to get current session use or current working session list..
Not SessionId...

推荐答案

引用该线程
http://stackoverflow.com/questions/1470334/list-all-active-asp-网络会话 [^ ]
和文章
获取所有活动会话数据 [
Refer this thread
http://stackoverflow.com/questions/1470334/list-all-active-asp-net-sessions[^]
and article
Retrieve All Active Sessions Data[^]


尝试一下:
Try this:
public static string TheSessionId() {
    HttpSessionState ss = HttpContext.Current.Session;
    HttpContext.Current.Session["test"] = "test";
    HttpContext.Current.Response.Write(ss.SessionID);
    return "ok";
}


此处找到了它 [如何获取SessionID [ ^ ]
asp.net会话示例:如何获取SessionID(会话ID) [ ^ ]


Found it here[^]

Refer similar discussion:
How to get SessionID[^]
asp.net session example: how to get SessionID (session id) for the current client[^]


foreach(string i in Session.Contents)   //returns active session variables.
{
    //Session[i];
}


这篇关于如何获取当前会话名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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