Welcome Guest, Not a member yet? Register   Sign In
Session not work on server
#8

[eluser]InsiteFX[/eluser]
Try below code.

IE has a problem with the sess_cookie_name:
Code:
$config[‘sess_cookie_name’] = ‘ci_session’;

// change to:
$config[‘sess_cookie_name’] = ‘cisession’;

Phil Sturgeon, sets the cookie parameters like below:
Code:
$config['cookie_prefix'] = "";
$config['cookie_domain'] = ($_SERVER['SERVER_NAME'] == 'localhost' ? '' : preg_replace('/^www\./', '', $_SERVER['SERVER_NAME']));
$config['cookie_path'] = BASE_URI;

Phil Sturgeon, also adds this to application/config/constants.php at the bottom.
Code:
/*
|--------------------------------------------------------------------------
| Docment root folders
|--------------------------------------------------------------------------
|
| These constants use existing location information to work out web root, etc.
|
*/

// Base URL (keeps this crazy sh*t out of the config.php
if (isset($_SERVER['HTTP_HOST']))
{
    $base_url  = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
    $base_url .= '://'. $_SERVER['HTTP_HOST'];
    $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);

    // Base URI (It's different to base URL!)
    $base_uri = parse_url($base_url, PHP_URL_PATH);

    if (substr($base_uri, 0, 1) != '/')
    {
        $base_uri = '/'.$base_uri;
    }

    if (substr($base_uri, -1, 1) != '/')
    {
        $base_uri .= '/';
    }
}

else
{
    $base_url = 'http://localhost/';
    $base_uri = '/';
}

// Define these values to be used later on
define('BASE_URL', $base_url);
define('BASE_URI', $base_uri);
define('APPPATH_URI', BASE_URI.APPPATH);

// We dont need these variables any more
unset($base_uri, $base_url);

Config.php base_url
Code:
$config['base_url'] = BASE_URL;

InsiteFX


Messages In This Thread
Session not work on server - by El Forum - 01-21-2011, 11:21 AM
Session not work on server - by El Forum - 01-21-2011, 02:05 PM
Session not work on server - by El Forum - 01-21-2011, 03:35 PM
Session not work on server - by El Forum - 01-26-2011, 11:38 AM
Session not work on server - by El Forum - 01-26-2011, 02:07 PM
Session not work on server - by El Forum - 01-26-2011, 03:40 PM
Session not work on server - by El Forum - 01-26-2011, 08:31 PM
Session not work on server - by El Forum - 01-26-2011, 09:01 PM
Session not work on server - by El Forum - 06-06-2011, 08:06 PM
Session not work on server - by El Forum - 04-05-2012, 07:56 PM
Session not work on server - by El Forum - 04-10-2012, 08:19 PM
Session not work on server - by El Forum - 09-11-2012, 01:31 AM
Session not work on server - by El Forum - 01-14-2013, 02:03 AM
Session not work on server - by El Forum - 12-18-2013, 07:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB