Welcome Guest, Not a member yet? Register   Sign In
Session creates new session id on every page load
#34

[eluser]Lockzi[/eluser]
[quote author="WanWizard" date="1287080532"]I use this:
Code:
// determine the domain and the path from the base_url
$base_url_parts = parse_url($config['base_url']);
$config['cookie_domain']    = $base_url_parts['host'];
$config['cookie_path']        = $base_url_parts['path'];
unset($base_url_parts);
This also sets the path right if you haven't installed the application in the website docroot, but in a directory...[/quote]

Yours didn't work for me at all...

Code:
Notice: Undefined index: path in /home/auinterface/public_html/application/config/config.php on line 257
A PHP Error was encountered

Severity: Notice

Message: Undefined index: path

Filename: config/config.php

Line Number: 257

The reason is that my $base_url_parts only exists of:
Code:
Array ( [scheme] => http [host] => subdomain.domain.se ) 1

You need to set path to '/' as default in case of the application actually is in the web root.

This would be a solution:

Code:
// determine the domain and the path from the base_url
$base_url_parts = parse_url($config['base_url']);
if(!key_exists('path', $base_url_parts))
{
    $base_url_parts['path'] = '/';
}
die(print_r($base_url_parts));
$config['cookie_domain']    = $base_url_parts['host'];
$config['cookie_path']        = $base_url_parts['path'];
unset($base_url_parts);

But I really rather go with mine in that case... Tongue


EDIT:
I just realized a huge problem... I'm not ending the $config['base_url'] with /.

Thanks for allowing me to find that problem Big Grin


Messages In This Thread
Session creates new session id on every page load - by El Forum - 07-17-2010, 01:32 PM
Session creates new session id on every page load - by El Forum - 07-18-2010, 12:55 AM
Session creates new session id on every page load - by El Forum - 07-18-2010, 11:58 AM
Session creates new session id on every page load - by El Forum - 07-18-2010, 12:23 PM
Session creates new session id on every page load - by El Forum - 07-18-2010, 12:25 PM
Session creates new session id on every page load - by El Forum - 07-18-2010, 12:51 PM
Session creates new session id on every page load - by El Forum - 07-18-2010, 03:18 PM
Session creates new session id on every page load - by El Forum - 07-18-2010, 03:23 PM
Session creates new session id on every page load - by El Forum - 07-25-2010, 07:20 PM
Session creates new session id on every page load - by El Forum - 07-25-2010, 08:18 PM
Session creates new session id on every page load - by El Forum - 07-25-2010, 08:53 PM
Session creates new session id on every page load - by El Forum - 07-25-2010, 09:31 PM
Session creates new session id on every page load - by El Forum - 07-26-2010, 05:51 AM
Session creates new session id on every page load - by El Forum - 07-26-2010, 12:22 PM
Session creates new session id on every page load - by El Forum - 07-27-2010, 08:54 AM
Session creates new session id on every page load - by El Forum - 07-27-2010, 09:09 AM
Session creates new session id on every page load - by El Forum - 07-27-2010, 09:16 AM
Session creates new session id on every page load - by El Forum - 07-27-2010, 09:26 AM
Session creates new session id on every page load - by El Forum - 07-27-2010, 09:54 AM
Session creates new session id on every page load - by El Forum - 07-27-2010, 10:35 AM
Session creates new session id on every page load - by El Forum - 07-27-2010, 11:08 AM
Session creates new session id on every page load - by El Forum - 07-27-2010, 02:43 PM
Session creates new session id on every page load - by El Forum - 07-27-2010, 02:47 PM
Session creates new session id on every page load - by El Forum - 07-28-2010, 04:57 PM
Session creates new session id on every page load - by El Forum - 07-28-2010, 05:01 PM
Session creates new session id on every page load - by El Forum - 07-29-2010, 12:41 AM
Session creates new session id on every page load - by El Forum - 10-13-2010, 04:19 PM
Session creates new session id on every page load - by El Forum - 10-13-2010, 04:37 PM
Session creates new session id on every page load - by El Forum - 10-14-2010, 12:35 AM
Session creates new session id on every page load - by El Forum - 10-14-2010, 02:30 AM
Session creates new session id on every page load - by El Forum - 10-14-2010, 02:40 AM
Session creates new session id on every page load - by El Forum - 10-14-2010, 06:41 AM
Session creates new session id on every page load - by El Forum - 10-14-2010, 07:22 AM
Session creates new session id on every page load - by El Forum - 10-14-2010, 07:45 AM
Session creates new session id on every page load - by El Forum - 10-14-2010, 08:05 AM
Session creates new session id on every page load - by El Forum - 05-26-2011, 05:51 PM
Session creates new session id on every page load - by El Forum - 08-09-2011, 11:37 AM
Session creates new session id on every page load - by El Forum - 08-11-2011, 06:40 PM
Session creates new session id on every page load - by El Forum - 08-13-2011, 08:08 PM
Session creates new session id on every page load - by El Forum - 08-15-2011, 03:02 AM
Session creates new session id on every page load - by El Forum - 02-03-2012, 12:21 PM
Session creates new session id on every page load - by El Forum - 02-03-2012, 05:32 PM
Session creates new session id on every page load - by El Forum - 02-03-2012, 05:40 PM
Session creates new session id on every page load - by El Forum - 02-16-2012, 01:47 PM
Session creates new session id on every page load - by El Forum - 02-24-2012, 10:32 AM
Session creates new session id on every page load - by El Forum - 03-16-2012, 06:57 AM
Session creates new session id on every page load - by El Forum - 04-11-2012, 02:49 PM
Session creates new session id on every page load - by El Forum - 06-05-2012, 04:45 PM
Session creates new session id on every page load - by El Forum - 06-05-2012, 05:14 PM
Session creates new session id on every page load - by El Forum - 06-05-2012, 07:31 PM
Session creates new session id on every page load - by El Forum - 06-06-2012, 11:26 AM
Session creates new session id on every page load - by El Forum - 06-06-2012, 11:38 AM
Session creates new session id on every page load - by El Forum - 06-06-2012, 11:48 AM
Session creates new session id on every page load - by El Forum - 06-10-2012, 11:43 AM
Session creates new session id on every page load - by El Forum - 06-22-2012, 01:26 AM
Session creates new session id on every page load - by El Forum - 06-22-2012, 02:00 AM
Session creates new session id on every page load - by El Forum - 06-22-2012, 03:58 AM
Session creates new session id on every page load - by El Forum - 07-06-2012, 10:30 AM
Session creates new session id on every page load - by El Forum - 10-19-2012, 12:23 PM
Session creates new session id on every page load - by El Forum - 11-23-2012, 05:01 AM
Session creates new session id on every page load - by El Forum - 04-03-2013, 02:30 PM
Session creates new session id on every page load - by El Forum - 04-04-2013, 01:36 PM
Session creates new session id on every page load - by El Forum - 04-22-2013, 11:16 AM
Session creates new session id on every page load - by El Forum - 04-22-2013, 12:40 PM
Session creates new session id on every page load - by El Forum - 04-22-2013, 01:52 PM
Session creates new session id on every page load - by El Forum - 04-23-2013, 05:25 AM
Session creates new session id on every page load - by El Forum - 08-21-2013, 11:20 AM
Session creates new session id on every page load - by El Forum - 08-22-2013, 12:05 AM
Session creates new session id on every page load - by El Forum - 08-25-2013, 03:40 AM
Session creates new session id on every page load - by El Forum - 12-18-2013, 07:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB