How do I get a session by SessionID in C#

佐手、 提交于 2020-01-16 05:12:05

问题


I'm working on an ASP.NET MVC app and I'm trying to use the 'Uploadify' JQuery plugin. One issue I'm running into is that there is apparently a well known bug in regards to sending up cookie information with Flash (which uploadify utilizes). So I've tried sending the auth token and the session id with my request when uploading a file using uploadify. This is great in that I can figure out if someone is authorized, but I can't seem to get the session and thus do not have access to session variables. If I have the SessionID, is there a way to get the Session in C#?


回答1:


Session["myVar"] = "1234";
<%= this.Session.SessionID %>

HttpContext.Session.SessionID

Note that you can get the session ID, but you need to store things in the temp data or it will keep giving you new IDs.

This post has the answer



来源:https://stackoverflow.com/questions/4339302/how-do-i-get-a-session-by-sessionid-in-c-sharp

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