Download & Extend

Forwarding every other time

Project:Secure Pages
Version:6.x-1.8
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

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

#1

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?

#2

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.

#3

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.

#4

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.

#5

What happens if you enable clean urls ?

#6

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

#7

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.

#8

Status:active» needs review

Please see http://drupal.org/node/587000#comment-4519010.

nobody click here