在同一个页面请求都是同一个session.但是,我在两个工程中,前一个设置值..后一个取值..怎么都取不到..
代码:
Project1->webapp1.aspx: Session["UserID"] = "user1";
Project2->webapp2.aspx: user1 = Session["UserID"];
从webapp1转到webapp2...就取不到值了..
要怎么取这值哦..

解决方案 »

  1.   

    Session State 有三种模式 
    1.InProc(默认的设定,这种情况Session放在进程中,容易丢失)
    2.SQL Server 数据库中存储Session
    3.State Server Service 使用服务器存储Session我们使用1模式,则不能跨项目使用。
      

  2.   

    你的Session是如何处理的,有没有保存值
      

  3.   

    我改成状态3后..出现在以下的错误?
    Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
      

  4.   

    sqlserver思路?
    从没用过..没头绪哦..
      

  5.   

    已经可以用SQLSERVER MODE了..要怎么保存和取值呢?
      

  6.   

    .net中的session原来还有三种模式 -_-!
      

  7.   

    用sqlserver模式是不是很耗资源啊?
      

  8.   

    StateServer才耗..不过..以现在的服务..这点算什么..
      

  9.   

    发现已经有存储在SQL里了..但是别一个PJ要怎么取出值来呢..
    兄弟们..帮哦..急..
      

  10.   

    cookie?
    有没有例子..拿让看下哦..
      

  11.   

    dutguoyi(新鲜鱼排):
      我用SQLSERVE MODE时,登陆Project1数据库里生成一个SESSION,通过链接到Project2->WebApp2,又生成了一个SESSION,那我怎么样才能得到前一个SESSION的值呢?