Welcome Guest, Not a member yet? Register   Sign In
Session Redirect Issue (maybe)
#1

[eluser]christeso[/eluser]
Hello,

All of a sudden my app stopped working. I get a white screen 500 error and no error log is produced.

To isolate the issue I created a simple test controller and view. I am able to call this view without error after clearing cookies. If I then refresh the page I get the 500 error again.

I am autoloading the following:
$autoload['libraries'] = array('database', 'session', 'cart');
$autoload['helper'] = array('image_helper','url','string_helper');

image_helper contains the following:

Code:
function image_thumb($image_path, $image_name, $height, $width)
{
    // Get the CodeIgniter super object
    $CI =& get_instance();

    // Path to image thumbnail
    $image_thumb = dirname($image_path) . '/' . $image_name . '_' . $height . '_' . $width . '.jpg';

    if( ! file_exists($image_thumb))
    {
        // LOAD LIBRARY
        $CI->load->library('image_lib');

        // CONFIGURE IMAGE LIBRARY
        $config['image_library']    = 'gd2';
        $config['source_image']     = $image_path;
        $config['new_image']        = $image_thumb;
        $config['maintain_ratio']   = TRUE;
        $config['height']           = $height;
        $config['width']            = $width;
        $CI->image_lib->initialize($config);
        $CI->image_lib->resize();
        $CI->image_lib->clear();
    }

    return '<img src="' . dirname($_SERVER['SCRIPT_NAME']) . $image_path . '" />';
}

If I remove the session autoload I can refresh to my hearts content.

I am locally testing using MAMP pro.

Any thoughts?

Thanks,
Chris
#2

[eluser]christeso[/eluser]
update: I increased error reporting threshold to 2 and found the following debug:

DEBUG - 2011-01-05 16:42:37 --&gt; Config Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Hooks Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; URI Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Router Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Output Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Input Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Global POST and COOKIE data sanitized
DEBUG - 2011-01-05 16:42:37 --&gt; Language Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Loader Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Helper loaded: image_helper
DEBUG - 2011-01-05 16:42:37 --&gt; Helper loaded: url_helper
DEBUG - 2011-01-05 16:42:37 --&gt; Helper loaded: string_helper
DEBUG - 2011-01-05 16:42:37 --&gt; Database Driver Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Session Class Initialized
DEBUG - 2011-01-05 16:42:37 --&gt; Encrypt Class Initialized

So, looks to be failing at Encrypt?
#3

[eluser]christeso[/eluser]
Successful debug log before refreshing:

DEBUG - 2011-01-05 16:46:19 --&gt; Config Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Hooks Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; URI Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Router Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Output Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Input Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Global POST and COOKIE data sanitized
DEBUG - 2011-01-05 16:46:19 --&gt; Language Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Loader Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Helper loaded: image_helper
DEBUG - 2011-01-05 16:46:19 --&gt; Helper loaded: url_helper
DEBUG - 2011-01-05 16:46:19 --&gt; Helper loaded: string_helper
DEBUG - 2011-01-05 16:46:19 --&gt; Database Driver Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Session Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Encrypt Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; A session cookie was not found.
DEBUG - 2011-01-05 16:46:19 --&gt; Session garbage collection performed.
DEBUG - 2011-01-05 16:46:19 --&gt; Session routines successfully run
DEBUG - 2011-01-05 16:46:19 --&gt; Session class already loaded. Second attempt ignored.
DEBUG - 2011-01-05 16:46:19 --&gt; Cart Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; Controller Class Initialized
DEBUG - 2011-01-05 16:46:19 --&gt; File loaded: socialView.php
DEBUG - 2011-01-05 16:46:19 --&gt; Final output sent to browser
DEBUG - 2011-01-05 16:46:19 --&gt; Total execution time: 0.0251
#4

[eluser]christeso[/eluser]
Solved!

By following this thread : http://ellislab.com/forums/viewthread/67566/ and installing http://codeigniter.com/wiki/Dariusz_Debo...ion_Class/




Theme © iAndrew 2016 - Forum software by © MyBB