Welcome Guest, Not a member yet? Register   Sign In
Session: Error while trying to free lock for ci_session
#9

(This post was last modified: 05-24-2016, 01:37 PM by consigliere.)

Thanks spjonez,

but I don get it, where to call session_write_close() ?
For example I am having this in MY_Controller in __construct:

PHP Code:
if(isset($this->session->userdata["user_id"])){
    
$data["userdata"] = $this->session->userdata;
        if (
$this->config->item($this->uri->segment(1), "lang_list") !== NULL){
            
$this->current_lang $this->uri->segment(1);
        }
    else{
        
$this->current_lang $this->session->userdata["lang"];
    }

Also I am having some other checks in session or update session variable like this:

PHP Code:
if (isset($this->session->userdata["notifications"]["budget"])) {
    
$notifacations $this->session->userdata["notifications"];
    
$notifacations["budget"] = true;
    
$this->session->set_userdata("notifications"$notifacations);

Where I should put session_write_close() ?
Also my app is heavily depends on AJAX calls.
I tried in __desctruct function of MY_Controller to add session_write_close() but with no success.
Beside this I have on numerous places in app where I do echo like this:
 
PHP Code:
<?php echo $this->session->userdata["lang"];?>
Should I after every operations with sessions to call session_write_close() function?
Reply


Messages In This Thread
RE: Session: Error while trying to free lock for ci_session - by consigliere - 05-24-2016, 01:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB