Welcome Guest, Not a member yet? Register   Sign In
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

(This post was last modified: 02-07-2017, 04:21 AM by InsiteFX.)

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 CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(02-07-2017, 04: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 CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(02-10-2017, 07: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 CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB