CodeIgniter Forums

Full Version: set_flashdata() returning false?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]chadsaun[/eluser]
I'm trying to use set_flashdata() but its returning false. Here is how I'm calling it...
Code:
$this->session->set_flashdata('error', 'Your username and password were incorrect.') or die("Couldn't set flashdata.");

Why would this output "Couldn't set flashdata" ? I've autoloaded the session library.

El Forum

[eluser]pistolPete[/eluser]
set_flashdata() isn't returning anything:
Code:
/**
     * Add or change flashdata, only available
     * until the next request
     *
     * @access    public
     * @param    mixed
     * @param    string
     * @return    void
     */
    function set_flashdata($newdata = array(), $newval = '')
    {
        if (is_string($newdata))
        {
            $newdata = array($newdata => $newval);
        }

        if (count($newdata) > 0)
        {
            foreach ($newdata as $key => $val)
            {
                $flashdata_key = $this->flashdata_key.':new:'.$key;
                $this->set_userdata($flashdata_key, $val);
            }
        }
    }

El Forum

[eluser]chadsaun[/eluser]
Yah you're right.

I restarted my browser and it works fine now.

Thanks.