Welcome Guest, Not a member yet? Register   Sign In
Session (with db) doesn't work "cross"-domain.
#1

[eluser]moodh[/eluser]
Hi, I'm currently trying to use sessions (encrypted and with a database) over alot of subdomains and a main domain:
http://username.portal.com ==> application/blogs
http://someotheruser.portal.com ==> application/blogs
http://portal.com ==> application/portal

The subdomains all go to a separate application, an the portal goes to its own, maybe thats where the problem lies?

If I log in on portal.com I'm still logged out (sessionvariable logged_in) on the subdomains.
I've changed the cookie setting for domain to '.portal.com' but no luck anyway.

Any ideas on what I've missed?

My settings:
Code:
$config['sess_cookie_name']    = 'db_session';
$config['sess_expiration']        = 0; // No expiration
$config['sess_encrypt_cookie']    = TRUE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']        = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']     = 300;

$config['cookie_prefix']    = "foo_";
if($_SERVER['HTTP_HOST'] == "localhost") {
    $config['cookie_domain']    = "";
} else {
    $config['cookie_domain']    = ".portal.com";
}
$config['cookie_path']        = "/";

Edit: was just Chrome playing tricks on me, all sorted now =)


Messages In This Thread
Session (with db) doesn't work "cross"-domain. - by El Forum - 10-12-2009, 09:37 AM
Session (with db) doesn't work "cross"-domain. - by El Forum - 10-13-2009, 01:38 PM
Session (with db) doesn't work "cross"-domain. - by El Forum - 10-13-2009, 02:53 PM
Session (with db) doesn't work "cross"-domain. - by El Forum - 10-14-2009, 12:50 AM
Session (with db) doesn't work "cross"-domain. - by El Forum - 10-14-2009, 01:26 AM
Session (with db) doesn't work "cross"-domain. - by El Forum - 07-17-2012, 04:57 AM
Session (with db) doesn't work "cross"-domain. - by El Forum - 07-17-2012, 05:07 AM
Session (with db) doesn't work "cross"-domain. - by El Forum - 07-17-2012, 05:30 AM
Session (with db) doesn't work "cross"-domain. - by El Forum - 07-17-2012, 08:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB