Welcome Guest, Not a member yet? Register   Sign In
Why is the "ci_sessions" table type MyISAM?
#21

[eluser]WanWizard[/eluser]
It's very simple, put this in your MY_Session.php:
Code:
function sess_write($write = FALSE)
{
    if ( $write )
    {
        parent::sess_write();
    }
}

This will ignore all standard calls to sess_write(). You have to explicitly call $this->session->sess_write(TRUE) for the record to be written.

You have to do that when the processing of your page request is finished. I use an HMVC approach with a fixed root controller, so I don't have to do this in every controller. I guess you could also do this in a post_controller hook.
You also have to do this before a redirect() as it will terminate your controller, so you have to make a MY_url_helper as well, to capture calls to the redirect() function.
And at any other location where code causes the normal CI flow to be disrupted (p.e. an exit or die statement).




Theme © iAndrew 2016 - Forum software by © MyBB