EllisLab text mark
Advanced Search
     
[resolved] Session Bug
Posted: 08 November 2007 09:58 AM   [ Ignore ]
Joined: 2007-06-13
76 posts

OK im not sure if this is a bug or not, i have a fresh install of CI and i havent changed the session data one bit and i have

class Test extends Controller {
    
public function session() {
        $this
->load->library('Session');
        
var_dump($this->session->userdata);
        
$this->session->set_userdata('test','1');
        
var_dump($this->session->userdata);
    
}

On each refresh here my session_id is regenerated i i lost the ‘test’ session i created there, so its not actually setting my sessions at all and just adding it into an array.

 
Posted: 08 November 2007 11:20 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-07-30
2144 posts

What does your config.php look like - particularly the section referencing cookies?

 Signature 

Follow me on twitter here.
MichaelWales.com | MichaelWales.info

 
Posted: 08 November 2007 08:25 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-06-13
76 posts

I have

$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

Like it is at the start of a fresh install, also i have

DEBUG 2007-11-09 10:23:31 --> Config Class Initialized
DEBUG 
2007-11-09 10:23:31 --> Hooks Class Initialized
DEBUG 
2007-11-09 10:23:31 --> Router Class Initialized
DEBUG 
2007-11-09 10:23:31 --> Output Class Initialized
DEBUG 
2007-11-09 10:23:31 --> Input Class Initialized
DEBUG 
2007-11-09 10:23:31 --> Global POST and COOKIE data sanitized
DEBUG 
2007-11-09 10:23:31 --> URI Class Initialized
DEBUG 
2007-11-09 10:23:31 --> Language Class Initialized
DEBUG 
2007-11-09 10:23:31 --> Loader Class Initialized
DEBUG 
2007-11-09 10:23:32 --> Database Driver Class Initialized
DEBUG 
2007-11-09 10:23:32 --> Controller Class Initialized
DEBUG 
2007-11-09 10:23:32 --> Session Class Initialized
DEBUG 
2007-11-09 10:23:32 --> A session cookie was not found.
ERROR 2007-11-09 10:23:32 --> SeverityWarning  --> Cannot modify header information headers already sent by (output started at D:\webserver\www\joshbenham.net\system\application\libraries\MY_Log.php:61D:\webserver\www\joshbenham.net\system\libraries\Session.php 282
ERROR 
2007-11-09 10:23:32 --> SeverityWarning  --> Cannot modify header information headers already sent by (output started at D:\webserver\www\joshbenham.net\system\application\libraries\MY_Log.php:61D:\webserver\www\joshbenham.net\system\libraries\Session.php 282
DEBUG 
2007-11-09 10:23:32 --> Final output sent to browser
DEBUG 
2007-11-09 10:23:32 --> Total execution time1.2929 

in the logs.

Dont worry about the warnings, they are from the var_dump’s

 
Posted: 08 November 2007 11:34 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2007-06-13
76 posts

Dont worry i worked it out, it was due to my own prob of doing a var_dump to see if it was getting but that was throwing an error which screwed it up.

 
Posted: 09 November 2007 12:51 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-23
3194 posts

Great stuff.  Thanks Michael also for the help.  Since this is in the bug forum, I’m going to close it, but if you want it re-opened just drop me a line.

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design