Welcome Guest, Not a member yet? Register   Sign In
session problem
#1

[eluser]magicbug[/eluser]
Hi All,

Im new to the whole CI thing and having a problem with session which i cant work out! I put

Code:
$this->load->library('session');

Inside my controller index but when i visit the controller /name/ in a web browser i get the following errors

Code:
A PHP Error was encountered

Severity: Warning

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

Filename: libraries/Session.php

Line Number: 268

Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /data/www/whatsmylocator.co.uk/beta/system/libraries/Exceptions.php:164)

Filename: libraries/Session.php

Line Number: 282

I cant seem to work out why this is actually happening!

Cheers Peter
#2

[eluser]Unknown[/eluser]
I am having the same problem too.

Cheers
Richard
#3

[eluser]OwanH[/eluser]
magicbug, can you provide more information? For example, are you only storing session data in cookies or have you also enabled CI's database storage of session data as well.
#4

[eluser]OwanH[/eluser]
Also in your 'system/application/config' folder, in the config.php file, what values are being assigned to the following variables:

Code:
$config['sess_cookie_name']
$config['sess_expiration']
$config['sess_encrypt_cookie']
$config['sess_use_database']
$config['sess_table_name']
$config['sess_match_ip']
$config['sess_match_useragent']

$config['cookie_prefix']
$config['cookie_domain']
$config['cookie_path']
#5

[eluser]magicbug[/eluser]
Hi Owan,

Code:
$config['sess_cookie_name']        = 'ci_session';
$config['sess_expiration']        = 7200;
$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['cookie_prefix']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']        = "/";

I think my problems are the fact I've not changed these!
#6

[eluser]OwanH[/eluser]
Hmm, I'll only ask you to make one slight change to those configuration settings but before I do, I need to ask two questions:

1. Are there any other CI powered sites you have running locally?

2. What URL do you type in to load the controller index, is it something like:

Code:
http://localhost/whatsmylocator.co.uk/beta
#7

[eluser]magicbug[/eluser]
1. Are there any other CI powered sites you have running locally?

Yes I have two running locally.

2. What URL do you type in to load the controller index, is it something like:

Code:
http://localhost/whatsmylocator.co.uk/beta/index.php/process
#8

[eluser]OwanH[/eluser]
OK, in your config.php file try changing

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

to

Code:
$config['cookie_path'] = "/whatsmylocator.co.uk/beta/";

I'm assuming the entire CI application for that site is in the beta folder, correct me if I'm wrong Smile. Your getting those error messages because somewhere, somehow your data is basically just vanishing, I am not sure why to be honest, but making this slight change is the only thing I can think of at the moment. Try it and let me know.

Oh, also delete any cookies you have stored for the domain "localhost" and path "/".
#9

[eluser]magicbug[/eluser]
That seems to have done the trick! Thankyou! Smile

Peter.
#10

[eluser]OwanH[/eluser]
Great , glad I could help :-).




Theme © iAndrew 2016 - Forum software by © MyBB