Welcome Guest, Not a member yet? Register   Sign In
Session Problem SOLVED!
#1

[eluser]Unknown[/eluser]
Hi everyone,

This is not to request a fix but to share a helpful tip as I have been troubleshooting a CI session issue for the better part of 2 solid days. I finally found my fix.

I was losing Session values at random times, sometimes on a redirect(), or sometimes at just really random times. I read *all* the forum links I could find about CI sessions, Native sessions, server times, config file settings and so on. Nothing worked.

As I was checking my cookies in Chrome I saw values were being created for both

mysite.com
and
www.mysite.com

By setting my
Code:
$config['base_url'] = 'http://www.mysite.com/';

and using a new .htaccess such as
Code:
RewriteEngine on
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

It is now working PERFECTLY and the last 2 days of my life feel complete.

I figured I would share in case you run into something similar, you can try my solution and see if it fixes the problem. :-)
#2

[eluser]Coding Pattern[/eluser]
Thanks, i luckily was using in the same way but never thought about the issue of cookies values for both.




Theme © iAndrew 2016 - Forum software by © MyBB