dpi9530 2015-04-27 12:38
浏览 26

每个会话缓存问题

I have a WordPress website and it's hosted by Hostgator.

  • I have two versions of the homepage which are served depending on the detected user agent.
  • Now the problem is that the user agent is not detected correctly on the first visit, but only on the second visit.
  • Another thing I've found that if I delete the cookies after the first visit (specifically: PHPSESSID) it does not detect the right user agent as long as i keep deleting the cookie after each page view.

These are the $_SERVER['HTTP_USER_AGENT'] values I am getting:

First view (the incorrect one):
Mozilla/5.0 (X11; CrOS x86_64 6680.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.102 Safari/537.36

Second view (the correct one):
Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53

Any idea how can I prevent this sort of caching?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 基于单片机数字电压表电路组成及框图
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line