简体   繁体   English

Codeigniter session 在重定向后被破坏

[英]Codeigniter session getting destroyed after redirect

May be a duplicate, but the answers on such questions does not work.可能是重复的,但这些问题的答案不起作用。

  1. CodeIgniter version: 3.1.13, the latest. CodeIgniter 版本:3.1.13,最新。
  2. Server Software: Ubuntu 20, Apache, PHP 8.0, PHP 8.1 C 服务器软件:Ubuntu 20、Apache、PHP 8.0、Z2FECZ388228A5C2B371

What's happening?发生了什么?

Session (logged in user information and other) getting destroyed after being redirected from an external website (probably Payment Gateway page) to the website with POST data. Session(登录用户信息和其他)在从外部网站(可能是支付网关页面)重定向到带有 POST 数据的网站后被破坏。

Is session getting destroyed after being redirected to the website without POST data? session 在没有 POST 数据的情况下被重定向到网站后是否被破坏?

No.不。

Are cookies getting destroyed? cookies 会被破坏吗?

No.不。


Session Data before getting redirected: www.example.com Session 重定向前的数据: www.example.com

在此处输入图像描述

Session Data after getting redirected from subdomain with POST data another.example.com. Session使用 POST 数据从子域重定向后的数据another.example.com。

在此处输入图像描述

Session Data after getting redirected from a different domain without any POST data example-two.com Session 在没有任何 POST 数据的情况下从不同域重定向后的数据示例二.com

在此处输入图像描述

Session Data after getting redirected from a different domain with POST data example-two.com Session使用 POST 数据示例二从不同域重定向后的数据。com

在此处输入图像描述

go to system/libraries/Session/session.php and find below code: go 到 system/libraries/Session/session.php 并找到以下代码:

ini_set('session.name', $params['cookie_name']);

and replace it with this code:并用以下代码替换它:

ini_set('session.id', $params['cookie_name']);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM