Welcome Guest, Not a member yet? Register   Sign In
Share user session across multiple subdomains?
#1

(08-01-2018, 03:46 AM)jreklund Wrote: I would do something like this:
http://demianlabs.com/lab/post/multisite...ual-hosts/

But keep two index.php files, one in /app1/ and one in /app2/ and manually change application path. No need to add PHP logic like the tutorial.

These should be the same in both application/config/config.php
$config['cookie_domain']    = "domain.com";
$config['sess_cookie_name'] = 'ci_session';

Hi admin, I'm new on codeigniter, (but not php or programing Big Grin ) that same cookie domain does not works for me my sites are on same domain but different sub domains, on same server, different mysql db's and totally different user table sutructure.
what is your advice?
Reply
#2

(This post was last modified: 05-02-2020, 02:07 AM by jreklund.)

For you to be able to access it form subdomains the cookie need to be named .domain.com.
Code:
$config['cookie_domain'] = ".domain.com";

And for sharing the same login on different databases, you can't. You need to combine it into one login server and different application databases. As you have no way of knowing where the userdata are stored.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB