【问题标题】:Session drop security token on BinaryFileResponseBinaryFileResponse 上的会话丢弃安全令牌
【发布时间】:2019-12-09 01:07:13
【问题描述】:

在我的应用程序中,当用户访问返回 BinaryFileResponse 的页面时,他会断开连接。

当我在返回之前放置一个骰子时,我可以转储会话和用户并重新加载而不会出现任何问题,但是每次应用程序提供文件时,用户都会在下一个请求时断开连接...... 它让我发疯了,因为我刚刚在问题出现之前进行了作曲家更新...... :(

我试图关闭会话句柄。 我尝试了所有其他路线......这是唯一放弃安全令牌的路线

<?php 

        // [...] 
        $response = new BinaryFileResponse($f->filePath(),200,[],false);
        $disposition = HeaderUtils::makeDisposition(
            $fileManager->getDisposition($f),
            $f->getFilename()
        );
        if($f->getEtag() !== null){
            $response->setEtag($f->getEtag());
        }

        $response->headers->set('Content-Disposition', $disposition);
        $response->headers->set('Content-Type', $f->getContentType());

        return $response;

它只是在下一个请求时丢弃安全令牌...这与流响应有关吗?

编辑:它只发生在 Chrome(最新的 macOS)上

【问题讨论】:

    标签: php apache symfony session nginx


    【解决方案1】:

    这是 Google Chrome 版本(版本 75.0.3770.142)中的一个错误;)

    【讨论】:

      猜你喜欢
      • 2014-10-27
      • 2015-09-28
      • 1970-01-01
      • 2020-04-17
      • 2010-10-05
      • 1970-01-01
      • 1970-01-01
      • 2010-12-04
      • 2010-09-13
      相关资源
      最近更新 更多