CodeIgniter Forums
New CodeIgniter "instance" destroys current session? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: New CodeIgniter "instance" destroys current session? (/thread-9571.html)

Pages: 1 2


New CodeIgniter "instance" destroys current session? - El Forum - 06-30-2008

[eluser]IanMcQ[/eluser]
Hi,

I'm running 4 instances of CodeIgniter on my website to power different departments and tools. All of these systems are interlinked. I just downloaded the newest version of CI (1.6.3) and ran through my configuration files and set them to the correct values (cookie paths, session management, routes, hooks, etc) which are "in agreement" with other CI instances on my site.

However, when I visit my newest CI instance, it destroys the current session that CI has set! I can log in and surf other tools just fine, but when I visit the newest instance of CI, just logs me out completely (of my other instances too!! it's not just that this new instance isn't picking up my session info - it actually logs me out globally).

Are there any values in the configuration that I need to check? If so, which ones should I check? Any other ideas as to what could be causing this?

Thanks...
Ian


New CodeIgniter "instance" destroys current session? - El Forum - 06-30-2008

[eluser]gon[/eluser]
You could try changing cookie domain and path at config.php


New CodeIgniter "instance" destroys current session? - El Forum - 06-30-2008

[eluser]IanMcQ[/eluser]
What's really weird is that it's set to the correct values. Since my CI instances are on different subdomains, all CI instances have .mysite.com for the cookie domain and / for the cookie path. I've already checked this...

Still no luck. Sad Any ideas?


New CodeIgniter "instance" destroys current session? - El Forum - 06-30-2008

[eluser]gon[/eluser]
If all cookies have .mysite.com, then they'll be shared between subdomains, and probably that's were the problem is.
You should change cookie domain for each subdomain AFAIK.


New CodeIgniter "instance" destroys current session? - El Forum - 06-30-2008

[eluser]IanMcQ[/eluser]
The point is to share cookies across all domains to have one account over the whole site...


New CodeIgniter "instance" destroys current session? - El Forum - 06-30-2008

[eluser]gon[/eluser]
Sorry, I read your post too fast :-)

Are you using webdeveloper firefox extension to debug how cookies are being set?


New CodeIgniter "instance" destroys current session? - El Forum - 06-30-2008

[eluser]IanMcQ[/eluser]
No, where can I download this?


New CodeIgniter "instance" destroys current session? - El Forum - 06-30-2008

[eluser]gon[/eluser]
http://chrispederick.com/work/web-developer/


New CodeIgniter "instance" destroys current session? - El Forum - 07-01-2008

[eluser]IanMcQ[/eluser]
This is really weird. All of my CI instances are successfully receiving and reading the "ci_session" cookie that is set. Within this cookie, there is a value key called "logged_in" which is pretty self-explanatory. On each CI instance, there's a hook that is ran and it checks whether or not the user is logged in (using the "logged_in" value) and if the user IS logged in, runs a query to update the cookie with the databases. What's happening on my newest CI copy is that it's not reading the "logged_in" value set at login and therefore isn't running the hook and so my session data is replaced with the traditional CI session cookie with these values:

Code:
[array]
(
     'session_id'    => random hash,
     'ip_address'    => 'string - user IP address',
     'user_agent'    => 'string - user agent data',
     'last_activity' => timestamp
)
which is why it appears that I'm "logged out."

Any ideas as to why my newest copy of CI wouldn't be picking up the session cookie data set by other CI instances? In my config files for all instances these are the values for the cookies:

Code:
$config['cookie_prefix']    = "";
$config['cookie_domain']    = ".thedailyneopets.com";
$config['cookie_path']        = "/";
AHHH! Thanks for your help.


New CodeIgniter "instance" destroys current session? - El Forum - 07-02-2008

[eluser]IanMcQ[/eluser]
Any ideas why it might not be picking up session data from other CI instances??