Welcome Guest, Not a member yet? Register   Sign In
Using Flashdata to pass data through a redirect()
#11

[eluser]WanWizard[/eluser]
There's no extra DB read involved, the session record is read into memory when you start the session.

I do find it a bit annoying however that every time you update a session variable it results in a row update. I solved that by overloading sess_write() in my MY_Session library:
Code:
// -----------------------------------------------------------------
/**
* Write the session data
*
* Our version only writes when we want to, CI calls sess_write() way to often!
*
* @access    public
* @return    void
*/
function sess_write($write = FALSE)
{
    if ($write)
    {
        parent::sess_write();
    }
}

and then calling it explicitly at the end of my page processing by passing the parameter TRUE.

Side-effect is that you lose your session updates if you do a redirect, so extend that as well so you can do a sess_write(TRUE) before redirecting...


Messages In This Thread
Using Flashdata to pass data through a redirect() - by El Forum - 10-01-2009, 04:32 AM
Using Flashdata to pass data through a redirect() - by El Forum - 10-01-2009, 07:17 AM
Using Flashdata to pass data through a redirect() - by El Forum - 10-01-2009, 07:35 AM
Using Flashdata to pass data through a redirect() - by El Forum - 10-01-2009, 09:50 AM
Using Flashdata to pass data through a redirect() - by El Forum - 10-01-2009, 05:15 PM
Using Flashdata to pass data through a redirect() - by El Forum - 10-02-2009, 12:59 AM
Using Flashdata to pass data through a redirect() - by El Forum - 02-05-2010, 04:32 AM
Using Flashdata to pass data through a redirect() - by El Forum - 02-05-2010, 06:19 AM
Using Flashdata to pass data through a redirect() - by El Forum - 02-05-2010, 06:37 AM
Using Flashdata to pass data through a redirect() - by El Forum - 05-04-2010, 03:35 PM
Using Flashdata to pass data through a redirect() - by El Forum - 05-04-2010, 03:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB