We're having an issue in which the Secure Pages module is forwarding the user to the SSL server on every other page visit. It is quite consistent with it as well... every other. We've cleared the cache, and nothing. I then dived into the source code, and found that in the securepages_match function, the function 'drupal_get_path_alias' is not defined on the times that the page is not forwarded. I then went into the system table, and changed the weights around to ensure that the path module is loaded before Secure Pages, but still getting the same issue. Has anyone else had this issue?

Comments

mikesir87’s picture

Update...it seems that it may not necessarily matter there. I kept digging, and it seems that when I comment out the line
$_SESSION['securepages_redirect'] = TRUE;
in the securepages_goto function, it works everytime. I'm still not 100% sure what this variable does. Any ideas? Is this truly needed?

adamo’s picture

I believe this is a duplicate of this:
http://drupal.org/node/420712

Check your Secure Pages config and make sure you don't have any blank lines in your include/exclude lists.

mikesir87’s picture

It looks fairly similar, but I don't think it's exactly the same because it's actually doing it on [site]/?q=user, not the home page.

I'm still not quite sure what was causing it, but we had to roll the site into production, so moved to another module. I would like to be able to help figure it out though. I'll see if I can get any more details.

primerg’s picture

I confirm this bug. Commenting out this line worked
$_SESSION['securepages_redirect'] = TRUE;

http://drupal.org/node/420712 isn't also an issue in my case.

Anonymous’s picture

What happens if you enable clean urls ?

mikesir87’s picture

I'm not able to enable clean urls due to my hosting environment. Sorry...

BrockBoland’s picture

Some more info:

securepages_match() is called during the hook_boot() or hook_init().

drupal_get_path_alias() is not defined when securepages_match() runs if you're using caching.

If you look in includes/bootstrap.inc, in _drupal_bootstrap(), hook_boot() is invoked during the DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE phase. path.inc, where drupal_get_path_alias() is defined, is not included until DRUPAL_BOOTSTRAP_PATH. hook_init() is invoked even later, in the DRUPAL_BOOTSTRAP_FULL phase (in _drupal_bootstrap_full() in includes/common.inc.

adr_p’s picture

Status: Active » Needs review
astonvictor’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

I'm closing it because the issue was created a long time ago without any further steps.

if you still need it then raise a new one.
thanks