Website routing through CloudFront, PHP Session Problem

huangapple go评论82阅读模式
英文:

Website routing through CloudFront, PHP Session Problem

问题

我有一个网站,例如:https://abcd.com,路由来自**AWS CloudFront。网站正常加载,但是会话不会保持其状态**。每次刷新页面时,会话都会被重置。

该网站使用Codeigniter和PHP开发。

如果通过负载均衡器或直接访问服务器进行路由,网站正常加载,并且会话保持其状态。但是通过CloudFront路由时,存在会话状态问题

有人可以帮忙吗?

英文:

I have a website eg: https://abcd.com, routing from AWS CloudFront. The website is loading properly. However, the session is not maintaining its state. On every refresh the session gets reset.

The website is developed using Codeigniter, PHP.

If the routing is through Load Balancer or directly to the server, the website loads properly and also the session maintains its state. But when routed through CloudFront, there is a session state problem.

Can anyone help?

答案1

得分: 1

将Cloudfront配置为将cookie转发到您的负载均衡器,特别是session_id。

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesForwardCookies

英文:

Configure Cloudfront to forward cookies to your load balancer, especially the session_id

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesForwardCookies

huangapple
  • 本文由 发表于 2020年1月6日 19:10:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/59611036.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定