Cached pages are not being redirected

ngmaloney - September 24, 2009 - 18:14
Project:Secure Pages
Version:6.x-1.8
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

We currently have a site deployed with caching enabled. I have a secure pages rule to redirect user* (for secure sign on). For some reason it would NOT redirect for anon users. After some hacking around the following fix seems to resolve the problem:

securepages.module (line 39)
/*
if ($cache) {
return;
}
*/

I commented out the section of the securepages_boot() that exits the function if the page is cached and it now works. Could someone with more knowledge than myself on this module explain the reasoning for stopping the securepages_boot hook if the page is cached? Not trying to second guess, only solve my problem at hand.

Below are our config settings:

Drupal: 6.14/MySql 5.x/PHP 5.2.6
Securepages: 6.x-1.8

Caching Settings
Caching mode: Normal
Page Compression: Enabled
Block cache: Enabled
Optimize CSS: Enabled
Optimize Javascript files: Enabled

Secure pages settings:
Secure Pages: Enabled
Switch back to http: True
Secure/Non-secure filled out properly

Pages: (Make secure only the listed)
node/add*
node/*/edit
user
user*
admin*

Ignore Pages
*/autocomplete/*
*/ajax/*

#1

stella - October 8, 2009 - 21:07

securepages.module (line 39)
/*
if ($cache) {
return;
}
*/

worked for me!

#2

stella - October 8, 2009 - 23:42

I spoke too soon, it's still not working. I think it's because when the page is cached, the $_SESSION['securepages_redirect'] doesn't get unset when you navigate away,... maybe.

#3

stella - October 8, 2009 - 23:50
Status:active» needs review

This patch seems to fix it for me. No guarantees, will see how it goes.

AttachmentSize
587000.patch 346 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.