CodeIgniter Forums
Strange errors with sessions - 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: Strange errors with sessions (/thread-10664.html)



Strange errors with sessions - El Forum - 08-07-2008

[eluser]Unknown[/eluser]
If this needs to be moved to Bug Reports, I'll be happy to repost. I've googled as much as I can without finding anything, which is why I don't think this is a bug, just sopmething I'm missing for being a n00b.

I'm using CI 1.6.3 on Ubuntu with Apache 2 and PHP 5.1.2. I'm getting strange error when I try to use sessions. Here're the errors I'm getting:

Quote:A PHP Error was encountered

Severity: Warning

Message: serialize() [function.serialize]: Node no longer exists

Filename: libraries/Session.php

Line Number: 296

...and...

Quote:A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/stlkr/system/libraries/Exceptions.php:164)

Filename: libraries/Session.php

Line Number: 315

I've checked all my config files, controllers, custom helpers, and view files, and I cannot see anytime where a space comes before the <?php tag. I've tried loading "session" in autoload.php and locally in the controller, but there's no change. Here's what my cookie settings in config.php look like:

Code:
$config['sess_cookie_name']    = 'ci_session';
$config['sess_expiration']    = 0;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']      = 'ci_sessions';
$config['sess_match_ip']    = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']     = 3000;

$config['cookie_prefix']    = "";
$config['cookie_domain']    = ".kinetix";
$config['cookie_path']        = "/stlkr";

".kinetix" is pretty much like "localhost", hence the lack of a tld.

I'm stumped here. Everything see to work except session. Any help would be appreciated. Thank you.


Strange errors with sessions - El Forum - 08-08-2008

[eluser]Unknown[/eluser]
Setting the following seems to have fixed it:

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

UPDATE: Never mind that above. This is what helped. It was apparently throwing some error before the headers were getting written, this messing them up.