会话管理的Web服务?Web

2023-09-05 00:28:17 作者:迷人的坏蛋

是否有可能来管理网络服务的会议?如果是,如何在它管理会议?它是类似于我们维持会话在JSP或PHP?哪里关于会议的信息将被存储,客户端或服务器?

is it possible to manage sessions in web-services? if yes, how to manage session in it? is it similar to sessions we maintain in JSP or PHP? where does the info about the session will be stored, Client or Server?

推荐答案

它是Java或.NET的问题?

Is it java or .net question?

在.net中,您可以轻松地使用Web服务上的托管服务器在的WebMethod 属性设置 EnableSession 参数会话状态,例如:

In .net you can easily use session state on webservice hosting server by setting EnableSession parameter in WebMethod attribute, for example:

[WebMethod(EnableSession = true)]
public bool Login(string login, string password)
{
    // you can use session here so for example log in user
    if(login = "administrator" && password = "secret")
       Session["authorizedUser"] = login;
}