CodeIgniter Forums

Full Version: Sessions working differently with and without WWW in url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've used the Codeigniter sessions library for user authentication.

Everything was working fine,
but i now noticed that sessions created by a page on are not being recognized by pages on

Seems like this problems has been present from the beginning. I could just notice it now.

Can someone who had the same problem and had solved it, please help me?
Well... www is actually a subdomain, and your session probably has valability only for the domain. So, in the config.php you should change the name of the cookie_domain parameter from something like:

PHP Code:
$config['cookie_domain']    = ''


PHP Code:
$config['cookie_domain']    = ''

(notice the dot...)