本文介绍了为什么当从外部来源(即Excel,Word等)点击链接时,Cookie无法识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,当从网络浏览器(例如从Excel或Word)中单击外部链接时,即使该链接在同一浏览器窗口的新标签页中打开,我的会话Cookie也最初无法识别。 p>

浏览器最终会识别它的cookie,但我很困惑为什么从Excel或Word的初始链接不工作。为了使它更具挑战性,点击链接在Outlook中可以正常工作。



有人知道为什么会发生这种情况吗?我使用的是PHP 5.3的Zend框架。

解决方案

这是因为MS Office使用Hlink.dll组件查找if链接是Office文档或其他。 MS Office希望在没有外部浏览器(使用IE6的Hlink.dll组件)的帮助下打开在文档内链接的文档。



如果会话cookie保护网站Hlink自然是重定向到登录页面并且已经到达HTML页面并且不能理解它在外部浏览器中打开它。请注意,它不会打开原始网址(预期的行为),但会打开重定向的结果,即使它是302重定向。



Microsoft在不支持的组件),而不是识别错误,他们(试图说服我们它是我们使用的SSO系统的缺陷,即会话cookie),并拒绝升级它。它提供了MS Office的的解决方法:

  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ 
Office\9.0\Common\Internet\ForceShellExecute:DWORD = 1

或提供给解决服务器,以避免HTTP重定向并更改为JavaScript重定向或META REFRESH重定向Hlink获取原始URL上的文本/ HTML页面,并使其运行外部浏览器来处理它)。


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 up in a new tab of the same browser window.

The browser ends up recognizing its cookie eventually, but I am puzzled as to why that initial link from Excel or Word doesn't work. To make it even more challenging, clicking a link works fine from Outlook.

Does anybody know why this might be happening? I'm using the Zend Framework with PHP 5.3.

解决方案

This is because MS Office is using Hlink.dll component to lookup if the link is Office document or something else. MS Office expect to open the document linked within documents without the aid of external browser (using Hlink.dll component of IE6).

If session cookie protects website Hlink naturally is being redirected to login page and having reached HTML page and not able to "understand" it opens it in external browser. Note that it opens not original URL (expected behavior) but the result of redirect, even if it was 302 redirect.

Microsoft has that bug in unsupported component (Hlink.dll), instead of recognizing the bug they turn it over to our head (trying to convince us that it is flaw of SSO system we use, i.e. session cookies) and refuses to upgrade it. It offers workaround that turns off the lookup functionality of MS Office:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
  Office\9.0\Common\Internet\ForceShellExecute:DWORD=1

Or offer us to workaround serverside, to avoid HTTP redirects and change into Javascript redirects or META REFRESH redirects (i.e. to have Hlink get text/html page on original URL and make it run external browser to handle it).

这篇关于为什么当从外部来源(即Excel,Word等)点击链接时,Cookie无法识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 07:16