Using Google Chrome, I am apparently losing/corrupting session data when moving between pages (PHP 5..4, Apache 2..54). The web site works perfectly fine in IE7/8, Opera, Safari &lifier Opera. The problem is just with Google Chrome.

I simplified lower the issue. I am using search friendly URL's, and hiding my front controller (index.php) using a .htaccess file. Therefore the URL appears like: www.domain.com/blah/blah/ Here's the .htaccess file contents:

Options +FollowSymlinks 
RewriteEngine on
#allow cool urls 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*) index.php [L] 
#allow to have Url without index.php 

Basically take away the .htaccess file, and expose the leading controller within the URL: www.domain.com/index.php/blah/blah/, Chrome works perfectly fine.

Any ideas ideas? I am thinking it's some type of trouble with how Chrome identifies what cookie to make use of and send towards the server? This occurs in Chrome 4 &lifier 5. Thanks!

Works out the problem was using the items in my .htaccess file. This resolved the problem:

#<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymlinks
    RewriteEngine on

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/.*(themes|wysiwyg|images|js)/

############################################
## always send 404 on missing favicon

    RewriteRule ^favicon.ico$ favicon.ico [L]

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    RewriteRule .* index.php

#</IfModule>

Use

 session_set_cookie_params(0, '/', '.domain.com');

to enforce the session cookie params. Take away the prefixed period if you're enforcing 'no www', or aren't using subdomains.

You may also try calling session_write_close() in the finish from the script to pressure PHP to create and close the session then there (this is particularly handy advertising media are redirect headers immediately after writing session data).

UPDATE:

Use this inside your .htaccess

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

I'd exactly the same problem, and also to repair it I only needed to produce a favicon.ico and put it within the webroot - otherwise I saw using Fiddler that the 404 resulted with this with every page request from Chrome (despite me not really connecting to some favicon within the page markup).

I believe this really is clearly a bug in Chrome, as the possible lack of a favicon shouldn't have any baring on session data.