Welcome Guest, Not a member yet? Register   Sign In
site wide cookie not working
#1

[eluser]dreamynsx[/eluser]
Hello,

I have a site that has multiple subdomains like test1.mydomain.com, test2.mydomain.com

I'm trying set the cookie so its side wide. The cookie is set but for each subdomain separately. Meaning login in from test1.mydomain.com does not keep me login to test2.mydomain.com. My auth / session code is based on freakauth light and all subdomain sites are using same session database.

Code:
setcookie(
    $this->sess_cookie,
    $this->userdata['session_id'],
    $this->sess_length + $this->now,
    $this->object->config->item('cookie_path'),
    $this->object->config->item('cookie_domain'),
    0
);


Quote:/*
|--------------------------------------------------------------------------
| 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_prefix'] = "";
$config['cookie_domain'] = '.mydomain.com';
$config['cookie_path'] = "/";


Messages In This Thread
site wide cookie not working - by El Forum - 12-04-2007, 12:11 AM
site wide cookie not working - by El Forum - 12-04-2007, 12:46 AM
site wide cookie not working - by El Forum - 12-04-2007, 12:53 AM
site wide cookie not working - by El Forum - 12-04-2007, 01:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB