我编写一个webserver程序:
HttpContext.Current.Session["UserName"] = "chp845";
//HttpContext.Current.Session.SessionID;//并把sessionID返回给客户端
1.请问客户端收到SessionId,如何通过httpwebrequest把sessionId给服务器验证?
2.服务器如何根据sessionID找到UserName?
HttpContext.Current.Session["UserName"] = "chp845";
//HttpContext.Current.Session.SessionID;//并把sessionID返回给客户端
1.请问客户端收到SessionId,如何通过httpwebrequest把sessionId给服务器验证?
2.服务器如何根据sessionID找到UserName?
2.服务器在内置的Session对象里面依据唯一的SessionID就定位到某个浏览器的Session,然后根据UserName就得到所属数值。
还有,我服务端如何获取发过来的sessionID?
namespace WebApplication3
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Stream inputStream = HttpContext.Current.Request.InputStream;
StreamReader reader = new StreamReader(inputStream, System.Text.Encoding.Unicode);
string responseContent = reader.ReadToEnd();
string resp = Class2.Disopose(responseContent);
Response.ContentType = "text/plain";
Response.Write(resp);
}
}
我需要获取客户端发过来的sessionID,所以我要知道怎么附加的呀?
}