CodeIgniter Forums
Cant access session CI 2.1.3 to subdomain CI 3.0.4 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Cant access session CI 2.1.3 to subdomain CI 3.0.4 (/showthread.php?tid=64926)



Cant access session CI 2.1.3 to subdomain CI 3.0.4 - insik - 04-12-2016

I cant access session data from "domain.com" to subdomain "sub.domain.com"
domain.com -> CI 2.1.3
sub.domain.com -> CI 3.0.4

I know that the version difference is causing this because when I tried CI 2.1.3 to CI 2.13 it worked. The $_SESSION is shared between the 2 application.

But I don't want to change any of our CI version

Is there any work around to share session between 2.1.3 and 3.0.4

Now it is only showing when I try print the session from my subdomain
Array ( [__ci_last_regenerate] => 1460446731)

And I noticed in the save path that my subdomain is saving its own session file

I hope someone could help me with this

Any input will be greatly appreciated. Thanks


RE: Cant access session CI 2.1.3 to subdomain CI 3.0.4 - Narf - 04-12-2016

No, they are completely different.


RE: Cant access session CI 2.1.3 to subdomain CI 3.0.4 - insik - 04-12-2016

(04-12-2016, 02:20 AM)Narf Wrote: No, they are completely different.

So there is no way to achieve what I want?


RE: Cant access session CI 2.1.3 to subdomain CI 3.0.4 - Narf - 04-12-2016

(04-12-2016, 02:43 AM)insik Wrote:
(04-12-2016, 02:20 AM)Narf Wrote: No, they are completely different.

So there is no way to achieve what I want?

No.

That's what I meant by saying "no". Smile


RE: Cant access session CI 2.1.3 to subdomain CI 3.0.4 - insik - 04-12-2016

(04-12-2016, 03:16 AM)Narf Wrote:
(04-12-2016, 02:43 AM)insik Wrote:
(04-12-2016, 02:20 AM)Narf Wrote: No, they are completely different.

So there is no way to achieve what I want?

No.

That's what I meant by saying "no". Smile

ok thanks. I think I will just use cookie to pass data and just put a hash for security.


RE: Cant access session CI 2.1.3 to subdomain CI 3.0.4 - cartalot - 04-12-2016

if they share the same database you could also pass a token and use that to store the info.


RE: Cant access session CI 2.1.3 to subdomain CI 3.0.4 - insik - 04-20-2016

(04-12-2016, 11:53 AM)cartalot Wrote: if they share the same database you could also pass a token and use that to store the info.

But they're expecting different fields in 'ci_sessions' table

e.g
CI 2.1.3 is using "user_data, timestamp" fields

wherein 

CI 3.0.4 it is "data, last_activity"

And we don't want to edit core files to correct those fields


RE: Cant access session CI 2.1.3 to subdomain CI 3.0.4 - insik - 04-21-2016

I got a work around for this. for this to work, we will not use the session library and do it the old way. It can now share session variable between the two.