两个虚拟目录间能共享session么?如过我想让两个网站间能传递信息(比如登录的用户信息)的话该怎么做?

解决方案 »

  1.   

    用 Web Service  可以实现
      

  2.   

    如果仅仅是为了共享用户登陆信息的话,那就不要用Session了吧,用Cookies比较方便,毕竟Session有丢失的危险和有效时间限制。/
      

  3.   

    建议用Cookie,看看这篇文章:
    http://www.tongyi.net/article/20030108/200301083561.shtml
      

  4.   

    http://community.csdn.net/Expert/topic/3337/3337412.xml?temp=8.433169E-02
    里面有个叫SESSION共享的,看看
      

  5.   

    SESSION比较难,用COOKIE现在的大网站包括CSDN都是单点登陆,多点认证的
      

  6.   

    thx,let me have a look!
      

  7.   

    http://www.microsoft.com/china/community/Column/47.mspx
      

  8.   

    Response.Write( "<form name=t id=t action=另一个网站的页面 method=post>" );
     
     foreach(object it in Session.Contents)
    {
    Response.Write("<input type=hidden name=" + it.ToString());
    Response.Write( " value=" + Session[it.ToString()].ToString() + " >");
    }if (Request.QueryString["destpage"] !=null)
    Response.Write("<input type=hidden name=destpage value=" +Request.QueryString["destpage"].ToString() +">");
    Response.Write("</FORM>");
    Response.Write("<scr" + "ipt>t.submit();</scr" + "ipt>");
    }
    </script>另一个网页:for (int i = 0; i < Session.Contents.Count; i++) 

    Response.Write("Assigned to \"" +Session.Keys[i].ToString()+"\""); 
    Response.Write(" Value: "+ Session[i].ToString() +"<BR>");