PHP drops sessions

software development

#1

I just figured this out. Maybe it’s a no-brainer, but I was dynamically generating my SSL url (ie, define(SSL_URL, https://mysite.com"); ) and didn’t put the www in the web address. PHP would promptly drop the session as soon as it hit the page.

Has anyone else had any experience with this? Is there a workaround? I’m asking because I have a secure cert for http://mysite.com but the rest of the site is using http://www.mysite.com. So as soon as I attempt to use the cert, down it goes.

================================
Angela Gann
CrimsonDryad Web Design Services
Web Design, Custom Software Development
http://www.crimsondryad.com


#2

Try using htaccess rewrite rule for the www then php should ok, I assume.lol.
Silk


#3

Try this in your root-level .htaccess file (if ya aint already done).

RewriteEngine On RewriteCond %{HTTP_HOST} !mysite.com RewriteRule ^.*$ http://mysite.com%{REQUEST_URI} [R]


#4

I just tried that, it didn’t work. Oh wait. The part on this particular site it needs to rewrite is ssl. Do I need to put “https” in the rewrite rule instead?

That probably seems like a no-brainer, but Mod Rewrites aren’t my forte. :slight_smile:

Thanks for the help!

================================
Angela Gann
CrimsonDryad Web Design Services
Web Design, Custom Software Development
http://www.crimsondryad.com


#5

Ack, yah. Sorry about that. You needs multiple conditions; try: RewriteEngine On RewriteCond %{SERVER_PORT} 443 RewriteCond %{HTTP_HOST} !mysite.com RewriteRule ^.*$ https://mysite.com%{REQUEST_URI} [R]