dqfxao2898 2018-06-19 12:36
浏览 68
已采纳

如何找出Symfony设置PHPSESSID cookie的原因/位置?

I am running a Symfony 2.8 based webpage which is separated into a public and a private part (login required).

Due to the "new" GDPR regulation in Europe I have checked which cookies my page actually use. Since I do not use any analytics or tracking tools are related stuff, the public part of the web page does actually need any cookies. However, when inspecting the page with Firefox Webmaster Tools I see that the PHPSESSID Cookie is set when visiting the public pages.

My code of the public pages does not actively uses the session (at least not that I am aware of). Sure the session needs to be queried to check if the user is logged in, is this enough to create a session if it does not exists? I suspect that some third party code/bundle might query the session and thus set the cookie.

Is there a way to find out where and why the cookie is set by symfony?

  • 写回答

1条回答 默认 最新

  • douqiao3453 2018-06-19 16:44
    关注

    Usually, php starts session when session_start() happens but it depends on php.ini settings. Symfony starts session dynamically when you first time try to do something with it. I had the same problem few days ago. In my case symfony starts session when tries to get user token from session. What I recommend to do: check what session handler you are using, then make a breakpoint inside it and debug. By default (and in my case) session starts at NativeSessionStorage start method.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭