Welcome Guest, Not a member yet? Register   Sign In
Setting $config['sess_use_database'] = TRUE Throwing Errors
#1

[eluser]georgegijo[/eluser]
I am encountering an error while trying to set the config value $config['sess_use_database'] = TRUE;. By default it was set to FALSE. When I change it to TRUE it gives all sorts of errors like the following:

A PHP Error was encountered
Severity: Notice

Message: Undefined index: session_id

Filename: libraries/Session.php

Line Number: 272


#2

[eluser]SPeed_FANat1c[/eluser]
did you create table ci_sessions like in user guide?
#3

[eluser]Beginers[/eluser]
You did not load your session I guess?

Code:
class Controller extends CI_Controller{
      public function __construct(){
       parent::__construct();
       $this->load->library('session');
      }
}
#4

[eluser]georgegijo[/eluser]
I am loading session library in my controller and have got the ci_sessions table. Please note that I am using Fuel CMS. I think this issue has something to do with any special Fuel CMS configuration. Any input on that?
#5

[eluser]Beginers[/eluser]
if you don't mind show us your code
#6

[eluser]georgegijo[/eluser]
ok, i got the issue. I compared the Session.php from an older version of codeigniter. I found that in sess_destroy() the code is trying to do the following stuff which was not in the other version of Session.php

Code:
// Kill session data
$this->userdata = array();

I commented it out and it's working ok.
#7

[eluser]dudel[/eluser]
[quote author="georgegijo" date="1351249362"]ok, i got the issue. I compared the Session.php from an older version of codeigniter. I found that in sess_destroy() the code is trying to do the following stuff which was not in the other version of Session.php

Code:
// Kill session data
$this->userdata = array();

I commented it out and it's working ok. [/quote]

is it ok to do that? can anyone confirm?. I'm experiencing the same issue. I have the same code on localhost and it's working. When i'm uploading it on remote server it shows up that errors
#8

[eluser]dudel[/eluser]
Oh. and another issue. if i set the project to production it works ok.
#9

[eluser]vicenrele[/eluser]
[quote author="dudel" date="1353492680"][quote author="georgegijo" date="1351249362"]ok, i got the issue. I compared the Session.php from an older version of codeigniter. I found that in sess_destroy() the code is trying to do the following stuff which was not in the other version of Session.php

Code:
// Kill session data
$this->userdata = array();

I commented it out and it's working ok. [/quote]

is it ok to do that? can anyone confirm?. I'm experiencing the same issue. I have the same code on localhost and it's working. When i'm uploading it on remote server it shows up that errors[/quote]

I had the same problem and I fixed it commenting that line. But I don't know if is the complete solution or will be other problems for this fix. Any idea?
I have to say that I dont't have the problem in localhost.




Theme © iAndrew 2016 - Forum software by © MyBB