【问题标题】:Why are awkward numbers and letters in my query string?为什么我的查询字符串中有尴尬的数字和字母?
【发布时间】:2010-06-02 21:41:49
【问题描述】:

我有一个 MVC 网站,当我执行它时,出现的查询字符串(url)是:

http://localhost:6970/(S(51aegi45qneolxa0oxwuzh55))/default.aspx

数字和字母的奇怪组合是什么鬼???请帮忙!!!!! 以前我一直在处理会话过期以重定向到我的一个观点,可能是这样的吗?我添加了以下操作过滤器:

public override void OnActionExecuting(ActionExecutingContext filterContext) 
        {
            HttpContextBase ctx = filterContext.HttpContext;

            // check if session is supported
            if (ctx.Session != null) 
            {
                // check if a new session id was generated
                if (ctx.Session.IsNewSession) 
                {
                    // If it says it is a new session, but an existing cookie exists, then it must
                    // have timed out
                    string sessionCookie = ctx.Request.Headers["Cookie"];
                    if ((null != sessionCookie) && (sessionCookie.IndexOf("ASP.NET_SessionId") >= 0))
                    {
                        filterContext.HttpContext.Response.Redirect("~/Error/SesionExpirada", true);
                    }
                }
            }

            base.OnActionExecuting(filterContext);
        }

但是如果我把它忽略它仍然会在我的网址中添加这种罕见的东西。 请帮忙!!!谢谢

【问题讨论】:

    标签: asp.net-mvc query-string


    【解决方案1】:

    我认为这意味着您启用了无 cookie 会话。

    在您的 web.config 设置中

    <sessionState cookieless="false" />
    

    【讨论】:

    • 据我所知,禁用无 cookie 会话的唯一后果是会话不适用于禁用 cookie 的人。除非事情发生了变化,否则 MVC forums.asp.net/p/1517391/3634908.aspx 甚至不支持这种模式
    猜你喜欢
    • 1970-01-01
    • 2018-03-19
    • 1970-01-01
    • 2018-10-27
    • 2018-11-24
    • 2010-09-18
    • 2011-04-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多