Why are cookies unrecognized when a link is clicked from an external source (i.e. Excel, Word, etc…)

后端 未结 17 2583
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 04:39

I noticed that when a link is clicked externally from the web browser, such as from Excel or Word, that my session cookie is initially unrecognized, even if the link opens u

17条回答
  •  再見小時候
    2020-11-28 05:06

    I had to solve this issue for an ASP.NET site but I only wanted to use javascript/ jQuery:

    var isCoBrowse = ('<%= Session["user"].ToString().ToLower() %>' != '0');
    if (isCoBrowse && window.location.href.indexOf('ReturnUrl=') >= 0 && window.location.href.indexOf('dllCheq') == -1) {
        //redirect to the ReturnUrl & add dllCheq to the URI
        var toRedirect = decodeURIComponent(gup('ReturnUrl', window.location.href)) + '&dllCheq';
        window.location = toRedirect;
    }
    

    I got the gup function from: How to get the value from the URL parameter?

提交回复
热议问题