Hi everyone,

I am using Drupal 7 and am having trouble getting sessions to persist when I swap between http and https. I am running Apache on CentOS.

I have tried adding$conf['https'] = TRUE; to sites/default/settings.php
After I did that I restarted my webserver and cleared the cache in Drupal.

I currently have the Secure Pages module installed but I was having the same problem previously anyway. I've tried searching for a solution to this problem but most of the results date back to older versions of Drupal!

Anyone have any ideas? Or could point me towards some more detailed documentation than just http://drupal.org/https-information?

Help would be greatly appreciated,

Chris

Comments

dono1’s picture

Chris,
With Secure Pages enabled have you tried setting your $base_url = 'https://www.yourdomain.com'; in settings.php?
We've done light testing on D7 as it is and haven't seen any issues switching from http | https for lost sessions. Yet...

milkmansrevenge’s picture

Hi Kris,

This solved the problem, thank you so much! I am curious as to why that would cause a problem but don't worry if there is no simple answer.

By the way, my drupal was installed to www.mysite.com/drupal rather than straight onto www.mysite.com so that may have been causing the issue.

Thanks again, I really appreciate it! :)

Chris

Edit:

PS: maybe this should go in the documentation somewhere? Or if it is already don't worry I obviously didn't notice it.

dono1’s picture

Simply put: setting the base to https:// forces the issue.
glad you're fixed up...