iyal
iyal

Reputation: 1285

with / without www issue in codeigniter session

I have a little problem with codeigniter. The problem is in the session with www and without www.

If I access the page in www.myweb.com, all data is loaded completely: css, js, and php template such as header.php and footer.php. However, it fails to load or to read the session such as userdata and facebook token.

It only loads the session if I access the web without www such as http://myweb.com.

What is wrong with this? Please help me, anybody.

Upvotes: 0

Views: 268

Answers (1)

Cameeob2003
Cameeob2003

Reputation: 482

This is due to the two sites having different "domains" so the session does not carry over from one to another. One way to fix this is to change your .htaccess file to direct traffic from the non-preferred URL to the preferred URL. There is more detail on how to set this up in this post: different session with url's with-www and without-www

Upvotes: 2

Related Questions