简体   繁体   中英

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.
  2. Server Software: Ubuntu 20, Apache, PHP 8.0, PHP 8.1

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.

Is session getting destroyed after being redirected to the website without POST data?

No.

Are cookies getting destroyed?

No.


Session Data before getting redirected: www.example.com

在此处输入图像描述

Session Data after getting redirected from subdomain with POST data another.example.com.

在此处输入图像描述

Session Data after getting redirected from a different domain without any POST data example-two.com

在此处输入图像描述

Session Data after getting redirected from a different domain with POST data example-two.com

在此处输入图像描述

go to system/libraries/Session/session.php and find below code:

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

and replace it with this code:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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