• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A PHP Error Severity: Notice Message: session_write_close(): Skipping numeric key 0

#1
I upgraded from codeigniter 2.21 to 3.1.3 and getting this error message
Reply

#2
The keys in the $ _SESSION associative array are subject to the same limitations as regular variable names in PHP,
ie they can not start with a number and must start with a letter or underscore.

For more details see the section on variables in the PHP manual.

Or you did not follow the upgrade right.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#3
(02-07-2017, 05:20 AM)InsiteFX Wrote: The keys in the $ _SESSION associative array are subject to the same limitations as regular variable names in PHP,
ie they can not start with a number and must start with a letter or underscore.

For more details see the section on variables in the PHP manual.

Or you did not follow the upgrade right.

I have followed the upgrade instructions. This error goes away if I write Session_write_close(); in the beginning of that controller class.
I just wanted to confirm is this a right way to do.
Reply

#4
You use it when you are finished with the session data that you are using.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#5
(02-10-2017, 08:33 AM)InsiteFX Wrote: You use it when you are finished with the session data that you are using.

I used it in the wrong way. I m not supposed to write session_write_close(); 
Earlier in the code we were using associative array by writing the following code 
$data_test_info=array(
'sphere',
'machine',
'temp',
'humidity',
'pressure'
);
But now I have changed it to 
$data_test_info=array(
            "key1" => "sphere",
            "key2" => "machine",
            "key3" => "temp",
            "key4" => "humidity",
            "key5" => "pressure"
        );
Now, it runs correctly. But I have doubt that is this change related with codeigniter update from 2.2.1 to 3.1.3. Because earlier the application was not having this error.
Reply

#6
In CI 3+ the session library has been completely re-written.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.