PHP puts the session id into the URL when cookies are turned off. Does this session id have to be accounted for (by proactively coding for it) in the case where .htaccess rewrite is being used?
Also, I presume that when cookies are off the session id cannot be propagated automatically when there are a mix of .php files and .html being served. That is, if a user navigates to an .html page from a .php page and then back to .php page, the session id is lost as the .html file cannot account for it. Is this correct?
In most cases the session ID does not figure in .htaccess processing because it is in the
QUERY_STRINGpart of the URL (that is, after a?). But you might have to account for it if you testQUERY_STRINGin aRewriteCondor replace it in aRewriteRule.And you presume correctly, the session ID will not propagate through a pure HTML file. However, you could use
.htaccessto run.htmlfiles through PHP:and something like this to activate the URL rewriting feature for those files:
where session_start.php contains just:
(See this SO question for details).
Or you could just put up an error page telling users that you don’t support running with cookies off.