Welcome Guest, Not a member yet? Register   Sign In
IE8 and session problem
#5

[eluser]InsiteFX[/eluser]
This is from PyroCMS and all credit goes to the PyroCMS Team.

application/config/constants.php
Code:
/*
|--------------------------------------------------------------------------
| Docment root folders - Place in application/config/constants.php
|--------------------------------------------------------------------------
| Author: Phil Sturgeon.
|
| These constants use existing location information to work out web root, etc.
|
*/

// Base URL (keeps this crazy stuff 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 localhost.
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);

aplication/config/config.php
Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://www.your-site.com/
|
*/

$config['base_url'] = BASE_URL;

/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path'   =  Typically will be a forward slash
|
*/
$config['cookie_domain']    = ($_SERVER['SERVER_NAME'] == 'localhost' ? '' : preg_replace('/^www\./', '', $_SERVER['SERVER_NAME']));
$config['cookie_path']        = BASE_URI;

InsiteFX


Messages In This Thread
IE8 and session problem - by El Forum - 09-16-2010, 12:16 PM
IE8 and session problem - by El Forum - 09-16-2010, 12:25 PM
IE8 and session problem - by El Forum - 09-16-2010, 12:54 PM
IE8 and session problem - by El Forum - 09-16-2010, 02:06 PM
IE8 and session problem - by El Forum - 09-16-2010, 10:17 PM
IE8 and session problem - by El Forum - 09-16-2010, 11:46 PM
IE8 and session problem - by El Forum - 11-01-2010, 06:40 PM
IE8 and session problem - by El Forum - 11-01-2010, 07:51 PM
IE8 and session problem - by El Forum - 02-22-2011, 04:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB