CodeIgniter Forums
Session recreated on each page - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Session recreated on each page (/showthread.php?tid=37513)



Session recreated on each page - El Forum - 01-12-2011

[eluser]joshbuckley[/eluser]
I've created a site using CodeIgniter and its built in session class. I've uploaded it to a Plesk server, which has given me a demo url of: https://1.2.3.4:8443/sitepreview/http/mysite.com (not actual url, different ip and folder).

A new session is being created on each page view - I can tell because session data isn't kept between pages, and each time a new page is accessed, the session table get a row added to it.

The session is kept correctly locally, where the cookie config is as follows:

Code:
$config['cookie_prefix']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']    = "/";

I'm guessing the issue is with the cookie - I've used firebug to check, it appears the cookie IS getting sent to the server, but the server is responing with a replacement cookie.

I've tried various settings with the live config, but not managed to get anything to work. The variation I think should work correctly is

Code:
$config['cookie_prefix']    = "";
$config['cookie_domain']    = "1.2.3.4:8443";
$config['cookie_path']    = "/sitepreview/http/mysite.com";

but it isn't!

Any ideas?


Session recreated on each page - El Forum - 01-12-2011

[eluser]Cristian Gilè[/eluser]
Hi joshbuckley,

could you provide some code (controller and view) and the session settings in the config.php file ?

Cristian Gilè


Session recreated on each page - El Forum - 01-13-2011

[eluser]joshbuckley[/eluser]
After a bit more googling, I've found that its actually the Plesk site preview thats causing the issue - its not passing cookie data it recieves to the page.

http://forums.theplanet.com/index.php?showtopic=54222