【问题标题】:Maintain session in subdomain在子域中维护会话
【发布时间】:2013-12-21 17:09:58
【问题描述】:

我有一个网址 www.myexample.in。我的一个页面导航到一个新的子域 test.myexample.in。在我的子域的 default.aspx 页面上,我检查了我在父域 (www.myexample.in) 中创建的会话。现在,当打开子域页面时,没有找到这样的会话值,session["employeeid"] 变为空白,之前我将employeeId 放入其中。

在我创建的父域中

session["employeeid"]="1233";

现在从我的项目中打开子域页面时,我得到空白值

string EmployeeId =  Convert.ToString(session["employeeid"]);
//EmployeeId is blank here

请告诉我如何将带有值的session["employeeid"] 传递给我的子域。我在 Web 配置中使用状态服务器

【问题讨论】:

    标签: c# asp.net session iis-7


    【解决方案1】:

    web.config中添加以下配置设置

    <httpCookies domain=".myexample.in"/>
    

    【讨论】:

      猜你喜欢
      • 2012-03-08
      • 1970-01-01
      • 1970-01-01
      • 2011-02-09
      • 2015-11-22
      • 2018-01-03
      • 2013-10-18
      • 2023-03-14
      • 1970-01-01
      相关资源
      最近更新 更多