Session keeps destroying after redirect inside iframe only - Codeigniter

298 Views Asked by At

I'm developing an app in shopify app market

As you know, shopify apps work in iframe. I've no problem in session when i directly use the app in browser without iframe. The issue is only within iframe.

I'll process oauth for shopify and redirect it to my app url inside the iframe. I'll set required session data if oauth is successfull. But as soon as the page is redirected to the dashboard page after setting session. The dashboard page doesn't have the session data which i set earlier

In oauth success block, i used this to set session data

$this->session->set_userdata('variable', array('uid' => 15));

In dashboard page, i used this to get session data

print_r($this->session->userdata('variable'));

But here i receive empty nothing else.

I tried many solutions in the web regarding this issue But their issue is with or without iframe.

I tried lots of solutions, but nothing worked for me

Fyi, CI Version is 3.1.11

PHP Version is 7.1.9 and also tested with 7.4.21

I tried

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

and manually commenting our session_start() and other lines in Session.php files and other stuff Nothing is fixed this issue

Any help would be greatly appreciated

0

There are 0 best solutions below