My project hangs on this single issue.
I have this code in my htaccess to implement a flat url system
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/page.php
RewriteRule (.*) page.php?pid=$1 [QSA]
While this code exists I cannot access session variables created on one page on any other page. Even if the pages are static .php pages that do not go through the redirection the sessions disappear. ONly this code somehow prevents sessions.
I have set session cookie path and domain to make sure the realm is correct, but it does not work.
Any help will be appreciated from the bottom of my heart.
The funny thing is it only fails on Chrome.
Per your comment:
I have set this additional code to make sure the session cookie is in right path and domain. ini_set('session.cookie_domain', '.bostonairporttaxicab.com'); ini_set('session.cookie_path', 'bostonairporttaxicab.com/';);
I think your cookie_path is wrong. It should not contain the domain name, as the path is the part trailing the domain name. Try setting it to /
and see if that fixes it. Maybe Chrome is interpreting it differently than the other browsers, and therefore rejecting your session cookie.
If it's not working on Chrome, it's your Chrome fault ... Browsers could do nothing with .htaccess
or SESSION
as they were running on the server-side. You should check it out from other computers via Chrome, if it's working then it's exactly Your Chrome fault, which I'm somehow sure about that ...
Have you started session on each page.
You will have to write session_start(); function at the top of the file just after the php
Htaccess file plays no role in session as your session variable lives alive till your session is active.