-
logoff page isn't redirecting properly
Hi, having looked around the forum I see a few responses to this but none seem to work.
When a customer logs off I get a message The page isn't redirecting properly this is the same in firefox and ie. Am not using ssl and the mesasage also says •Make sure that the web address http://mywebsite.co.uk is correct. Which does exist
This site meant to go live in 2 days
Help please
Thanks
-
Re: logoff page isn't redirecting properly
Ummm. That web address isn't your site. Can't help much without it.
Routine: check what the differences are between your site and a vanilla install. Does the same thing. Occur if you use the default template? What has been modified? What files are listed in includes/modules/pages/logoff?
-
Re: logoff page isn't redirecting properly
thanks for getting back to me
site located at megalarm.co.uk/megalarm
logoff contains
<?php
/**
* logoff header_php.php
*
* @package page
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: header_php.php 5403 2006-12-27 00:38:58Z drbyte $
*/
// This should be first line of the script:
$zco_notifier->notify('NOTIFY_HEADER_START_LOGOFF');
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
/**
* Check what language should be used on the logoff screen
*/
$logoff_lang = ($_SESSION['languages_code'] != DEFAULT_LANGUAGE) ? 'language=' . $_SESSION['languages_code'] : '';
/**
* Check if there is still a customer_id
* If so, kill the session, and redirect back to the logoff page
* This will cause the header logic to see that the customer_id is gone, and thus not display another logoff link
*/
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
zen_session_destroy();
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
// This should be last line of the script:
$zco_notifier->notify('NOTIFY_HEADER_END_LOGOFF');
?>
-
Re: logoff page isn't redirecting properly
Is that the only file in the directory? (Is there more than one file and if so what are the filenames?)
So, I don't currently have access to either of the "trouble" browsers, but without logging in I went to: /index.php?main_page=logoff and did not have any trouble that I could see...
-
Re: logoff page isn't redirecting properly
Yes that is the only file in that folder header_php.php text of which is above. Yes if i go to the page directly it goes there but not if logged in as a customer and then go to logout. Any chance you can create an account log in and then try to log out to see the problem?
-
Re: logoff page isn't redirecting properly
Okay, should see that I created a temp user. After account creation/login, went to a product area, then went directly to the logoff url.
Had following results:
On screen: Error There are too many redirections for this web address. With a try again button.
Header: Error moved temporarily.
URL remained the same. Trying "button"... Didn't work. :P same place.
So what's in the base site? Have an .htaccess file? Have one in the current directory? Otherwise what are the settings in the admin/configuration/sessions menu?
-
Re: logoff page isn't redirecting properly
Hi No htaccess in root of domain
htaccess in root of shop just says SetEnv DEFAULT_PHP_VERSION 5
cannot find admin/configuration/sessions only admin configuration.php which has
<?php
/**
* @package admin
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: Ian Wilson Thu Aug 16 12:36:12 2012 +0100 Modified in v1.5.1 $
*/
require('includes/application_top.php');
$action = (isset($_GET['action']) ? $_GET['action'] : '');
if (zen_not_null($action)) {
switch ($action) {
case 'save':
// demo active test
if (zen_admin_demo()) {
$_GET['action']= '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
}
$configuration_value = zen_db_prepare_input($_POST['configuration_value']);
$cID = zen_db_prepare_input($_GET['cID']);
$db->Execute("update " . TABLE_CONFIGURATION . "
set configuration_value = '" . zen_db_input($configuration_value) . "',
last_modified = now() where configuration_id = '" . (int)$cID . "'");
$configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
from ' . TABLE_CONFIGURATION;
$configuration = $db->Execute($configuration_query);
// set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'true') ) {
$db->Execute("update " . TABLE_CONFIGURATION . "
set configuration_value = 'false', last_modified = '" . NOW . "'
where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); }
$configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
from ' . TABLE_CONFIGURATION;
$configuration = $db->Execute($configuration_query);
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
break;
}
}
$gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1;
$_GET['gID'] = $gID;
$cfg_group = $db->Execute("select configuration_group_title
from " . TABLE_CONFIGURATION_GROUP . "
where configuration_group_id = '" . (int)$gID . "'");
if ($gID == 7) {
$shipping_errors = '';
if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') {
$shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP;
}
if (zen_get_configuration_key_value('ORDER_WEIGHT_ZERO_STATUS') == '1' and !defined('MODULE_SHIPPING_FREESHIPPER_STATUS')) {
$shipping_errors .= '<br />' . ERROR_ORDER_WEIGHT_ZERO_STATUS;
}
if (defined('MODULE_SHIPPING_USPS_STATUS') and (MODULE_SHIPPING_USPS_USERID=='NONE' or MODULE_SHIPPING_USPS_SERVER == 'test')) {
$shipping_errors .= '<br />' . ERROR_USPS_STATUS;
}
if ($shipping_errors != '') {
$messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution');
}
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
cssjsmenu('navbar');
if (document.getElementById)
{
var kill = document.getElementById('hoverJS');
kill.disabled = true;
}
}
// -->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo $cfg_group->fields['configuration_group_title']; ?></td>
<td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" width="55%"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
</tr>
<?php
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
while (!$configuration->EOF) {
if (zen_not_null($configuration->fields['use_function'])) {
$use_function = $configuration->fields['use_function'];
if (preg_match('/->/', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
$cfgValue = zen_call_function($class_method[1], $configuration->fields['configuration_value'], ${$class_method[0]});
} else {
$cfgValue = zen_call_function($use_function, $configuration->fields['configuration_value']);
}
} else {
$cfgValue = $configuration->fields['configuration_value'];
}
if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $configuration->fields['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
$cfg_extra = $db->Execute("select configuration_key, configuration_description, date_added,
last_modified, use_function, set_function
from " . TABLE_CONFIGURATION . "
where configuration_id = '" . (int)$configuration->fields['configuration_id'] . "'");
$cInfo_array = array_merge($configuration->fields, $cfg_extra->fields);
$cInfo = new objectInfo($cInfo_array);
}
if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id'] . '&action=edit') . '\'">' . "\n";
}
?>
<td class="dataTableContent"><?php echo $configuration->fields['configuration_title']; ?></td>
<td class="dataTableContent"><?php echo htmlspecialchars($cfgValue, ENT_COMPAT, CHARSET, TRUE); ?></td>
<td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id']) . '" name="link_' . $configuration->fields['configuration_key'] . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
</tr>
<?php
$configuration->MoveNext();
}
?>
</table></td>
<?php
$heading = array();
$contents = array();
switch ($action) {
case 'edit':
$heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
if ($cInfo->set_function) {
eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE) . '");');
} else {
$value_field = zen_draw_input_field('configuration_value', htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE), 'size="60"');
}
$contents = array('form' => zen_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
if (ADMIN_CONFIGURATION_KEY_ON == 1) {
$contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
}
$contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
$contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
$contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE, 'name="submit' . $cInfo->configuration_key . '"') . ' <a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;
default:
if (isset($cInfo) && is_object($cInfo)) {
$heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
if (ADMIN_CONFIGURATION_KEY_ON == 1) {
$contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
}
$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
$contents[] = array('text' => '<br>' . $cInfo->configuration_description);
$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($cInfo->date_added));
if (zen_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($cInfo->last_modified));
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' <td width="25%" valign="top">' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' </td>' . "\n";
}
?>
</tr>
</table></td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
-
Re: logoff page isn't redirecting properly
Try accessing from logging into your admin. :P then configuration dropdown menu, then the sessions option under that list. :)
-
Re: logoff page isn't redirecting properly
lol ok i see admin
it says
Title Value Action
Session Directory /home/sites/megalarm.co.uk/public_html/megalarm/cache
Cookie Domain True Info
Force Cookie Use False Info
Check SSL Session ID False Info
Check User Agent False Info
Check IP Address False Info
Prevent Spider Sessions True Info
Recreate Session True Info
IP to Host Conversion Status true Info
Use root path for cookie path False Info
Add period prefix to cookie domain True
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
Congerman
lol ok i see admin
it says
Title Value Action
Session Directory /home/sites/megalarm.co.uk/public_html/megalarm/cache
Cookie Domain True Info
Force Cookie Use False Info
Check SSL Session ID False Info
Check User Agent False Info
Check IP Address False Info
Prevent Spider Sessions True Info
Recreate Session True Info
IP to Host Conversion Status true Info
Use root path for cookie path False Info
Add period prefix to cookie domain True
And just for clarity:
Quote:
/home/sites/megalarm.co.uk/public_html/megalarm
is actually where this site is held not somewhere "deeper" past that?
Two things still:
1) Does the same problem exist when you temporarily use the ZC default template?
2) What was the origin of this database? Was it a fresh install, or did it "migrate" from somewhere else?
-
Re: logoff page isn't redirecting properly
/home18/megalarmco/public_html/megalarm/
yes on default
migrated
-
Re: logoff page isn't redirecting properly
May I suggest if not already done to download and run Fix Cache Key?
-
Re: logoff page isn't redirecting properly
oh could that of been the problem?
been speaking with my hosting provider who has now turned off Unixy Varnish cache and that seems to of fixed it. Would running fix cache key eliminated the need to turn off caching? will there be a problem with the caching turned off?
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
Congerman
oh could that of been the problem?
been speaking with my hosting provider who has now turned off Unixy Varnish cache and that seems to of fixed it. Would running fix cache key eliminated the need to turn off caching? will there be a problem with the caching turned off?
Well, kind of depends on what you consider a problem... Caching is used to speed up access to the site. So no caching, slower speed... Impacts visitors experience... It could have been the issue, and if caching being disabled seems to fix that then correcting the caching might also fix that. (Such a process is already in place in. ZC 1.5.3 and above)
The other part to that could be information in the includes/configure.php where DIR_FS_CACHE is defined and there is a setting just above that indicating where to cache things, none, db, or file. As well, the permissions of the directory referenced by the above constant...
-
Re: logoff page isn't redirecting properly
Many thanks for your time this evening. I will run fix cache and turn caching back on in control panel. But it will not be tonight as have early start tomorrow. will post back here with results soon. Thank you very much for the help
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
Congerman
Many thanks for your time this evening. I will run fix cache and turn caching back on in control panel. But it will not be tonight as have early start tomorrow. will post back here with results soon. Thank you very much for the help
Welcome, just remember the "little" people when you become rich and famous, though more importantly the organization that has made all this possible: zen-cart. :)
-
Re: logoff page isn't redirecting properly
Will never become rich and famous but I do really appreciate zen cart and its community
-
Re: logoff page isn't redirecting properly
phew fix cache worked on new site transfer. dam i wish i had noticed that before.. thank you for your help
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
Congerman
phew fix cache worked on new site transfer. dam i wish i had noticed that before.. thank you for your help
Welcome. Now get to work on upgrading. 1.5.1 is more than 4 years old and several versions behind. :)
-
Re: logoff page isn't redirecting properly
still waiting in anticipation for version 2 that has been on the cards for ages before updating and then updating again
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
Congerman
still waiting in anticipation for version 2 that has been on the cards for ages before updating and then updating again
Umm, well, other technology changes (PHP specifically) may force you to do otherwise. Any currently acceptable version of PHP is already ahead of the original design parameters of ZC 1.5.1... PHP 5.4 is considered even below minimum recommended by the PHP community and with that ZC 1.5.1 requires minor mods...5.6 is the minimum suggested and 7.0 is becoming commonplace (ZC 1.5.5 is the first version that will support that).
-
Re: logoff page isn't redirecting properly
ok dam more work on my, and my customers, 22 zen cart shops lol Good night and thank you for the advice
-
Re: logoff page isn't redirecting properly
I've just moved my site to a new server, and have expereinced the same error.
The Fix Cache Key module is not supposed to be needed after v1.5.3. I'm running v1.5.5d, so should I still use this, or will this cause problems?
-
Re: logoff page isn't redirecting properly
I had a dedicated IP with SSL on the old server. Had my whole cpanel account moved over to another server, including the SSL certificate (no dedicated IP on the new server, don't think I need it). Not sure if all that is relevant, but everything appears to be working perfectly on the new server, except the logout page throwing up re-direct errors.
Perhaps there's just a cache I need to clear???
-
Re: logoff page isn't redirecting properly
So I just went to https://tabletennisshop.com[dot]au/ (based off of the signature in your post), didn't create an account, but went to index.php?main_page=logoff, and had no difficulties. Perhaps things would be different if I had an account, but that would require you to confirm that you also had issues when attempting what I did. Ie. If you had problems but I didn't, then would suspect something local to your computer/browser. If I (and others including yourself) could do the above, then there is something with being logged in that is likely the issue. Understand that finding that issue requires more than just saying I have a problem... need to understand what is installed, how things have been modified away from the default installation and what has been incorporated to cause/allow the issue...
-
Re: logoff page isn't redirecting properly
Thank you for trying that. yes that is the correctg site.
Yes that URL worked fine for me as well. But it does not work if I actually log in, then click the logout link.
I also tried from a browser (IE), that I had not used before for this site. I created an account, logged in, then logged out. It worked first time (although it seemed to take a long time). Tried it again, then it came up with the same error (too many redirects).
I've since cleared all the data and cookies from the browser, it still comes up with the error.
Old server: SSL + dedicated IP
New server: same SSL certificate but no dedicicated IP
Old server PHP 5.4
New server: PHP 5.6 or 7.1
As I mentioned, the site worked perfectly on the old server. When the complete cpanel account was moved to a new server, this issue started happening.
Should I run the Fix Cache Key module, or will this not work on v1.5.5d?
-
Re: logoff page isn't redirecting properly
The site is pretty much a standard installation, freshly installed from v1.5.5d with the sheffield blue responsive module. No other modules installed that modifiy URLs or anything like that.
I temporarily renamed my .htaccess to see if that was causing it, but that made no difference.
-
Re: logoff page isn't redirecting properly
I'm really don't know where to start with this... if anyone can offer any tips, I'd really appreciate it!
-
Re: logoff page isn't redirecting properly
Check your /includes/configure.php file, making sure that it's "in sync" with any .htaccess redirect directives.
That is, if your configure.php contains a www. prefix, make sure that the .htaccess isn't redirecting to non-www. (and vice versa).
Make sure, too, that your configure.php specifies either 'true' or 'false' for the USE_SSL definition; I've seen 1.5.5 upgrades where it's set to '' (an empty string), which can be problematic.
-
Re: logoff page isn't redirecting properly
to make sure i understand, this worked perfectly before; the site was moved to a new server; and now you are getting too many redirects before it errors out? is that correct?
if so, it seems that your new server is configured differently than the old server. from what i can gather, the logoff page is NOT destroying the session data. the code from:
includes/modules/pages/logoff/header_php.php
Code:
/**
* Check if there is still a customer_id
* If so, kill the session, and redirect back to the logoff page
* This will cause the header logic to see that the customer_id is gone, and thus not display another logoff link
*/
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
zen_session_destroy();
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
this would explain why the page works perfectly if one is not logged in, but fails when the customer is logged in. so something is different on the server with regards to the session data.
one could try the following code:
Code:
/**
* Check if there is still a customer_id
* If so, kill the session, and redirect back to the logoff page
* This will cause the header logic to see that the customer_id is gone, and thus not display another logoff link
*/
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
session_start();
zen_session_destroy();
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
and see if that addresses the problem.... but i'm really guessing blind based on some reading i'm doing.
there are plenty of threads out there on session_destroy not deleting $_SESSION variables. the above references one such solution.
good luck!
-
1 Attachment(s)
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
lat9
Check your /includes/configure.php file, making sure that it's "in sync" with any .htaccess redirect directives.
That is, if your configure.php contains a www. prefix, make sure that the .htaccess isn't redirecting to non-www. (and vice versa).
Make sure, too, that your configure.php specifies either 'true' or 'false' for the USE_SSL definition; I've seen 1.5.5 upgrades where it's set to '' (an empty string), which can be problematic.
i do not think these 'solutions' are the problem. see screenshot:
Attachment 17840
-
Re: logoff page isn't redirecting properly
Thank you!
Quote:
Originally Posted by
carlwhat
to make sure i understand, this worked perfectly before; the site was moved to a new server; and now you are getting too many redirects before it errors out? is that correct?
Yes that is exactly what happened.
Quote:
Originally Posted by
carlwhat
if so, it seems that your new server is configured differently than the old server. from what i can gather, the logoff page is NOT destroying the session data. the code from:
includes/modules/pages/logoff/header_php.php
Code:
/**
* Check if there is still a customer_id
* If so, kill the session, and redirect back to the logoff page
* This will cause the header logic to see that the customer_id is gone, and thus not display another logoff link
*/
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
zen_session_destroy();
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
this would explain why the page works perfectly if one is not logged in, but fails when the customer is logged in. so something is different on the server with regards to the session data.
one could try the following code:
Code:
/**
* Check if there is still a customer_id
* If so, kill the session, and redirect back to the logoff page
* This will cause the header logic to see that the customer_id is gone, and thus not display another logoff link
*/
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
session_start();
zen_session_destroy();
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
and see if that addresses the problem.... but i'm really guessing blind based on some reading i'm doing.
there are plenty of threads out there on session_destroy not deleting $_SESSION variables. the above references one such solution.
good luck!
I tried that, but it did not work.
I'll look for other threads relating to this, see if I can find a solution.
THank you!
-
Re: logoff page isn't redirecting properly
Hmmm could not find any other references, except really old one.
Should it perhaps be zen_session_start(); instead of session_start();?
-
Re: logoff page isn't redirecting properly
There are my session settings:
Session Directory /home2/xxxxxx/public_html/cache
Cookie Domain True
Force Cookie Use False
Check SSL Session ID False
Check User Agent False
Check IP Address False
Prevent Spider Sessions True
Recreate Session True
IP to Host Conversion Status true
Use root path for cookie path False
Add period prefix to cookie domain True
-
Re: logoff page isn't redirecting properly
ok, this is one of the things that drives me crazy - not understanding how something works! perhaps @DrByte (or someone else) can chime in.
i have a working ZC with a working logoff page. if i change my code to such:
Code:
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
echo '111--------> ' .$_SESSION['customer_id'] . ' <----------';
zen_session_destroy();
echo '2222--------> ' . $_SESSION['customer_id'] . ' <----------';
die(__FILE__ . ':' . __LINE__);
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
my customer_id is still there, and yet my logoff page works, so my customer_id is getting destroyed somewhere else. in fact, when i looked at all my $_SESSION variables here, i did not see zen_session_destroy() doing much of anything (although i did not look that close). what to make of that?
my page works, yours does not. you can try the following code:
Code:
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
zen_session_destroy();
unset($_SESSION['customer_id']);
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
pretty sure that will work, although i'm not sure about any other intended consequences....
let us know.
best.
-
Re: logoff page isn't redirecting properly
Thank you again!
It does not seem to work either... unless the logoff file is cashed somehow. I tried several times with different browsers.
-
Re: logoff page isn't redirecting properly
try running that fix cache key file as indicated here:
https://www.zen-cart.com/showthread....10#post1304910
despite it saying it is not necessary after v1.5.3, it can not hurt.
if that does not work, change the code as such, and report back what happens:
Code:
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
zen_session_destroy();
die('trying to logoff');
unset($_SESSION['customer_id']);
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
-
Re: logoff page isn't redirecting properly
I tried the fix cache key, did not fix it.
Tried your new code, it comes up with a blank page with just your text "trying to logoff" at the top left.
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
lat9
Check your /includes/configure.php file, making sure that it's "in sync" with any .htaccess redirect directives.
That is, if your configure.php contains a www. prefix, make sure that the .htaccess isn't redirecting to non-www. (and vice versa).
Make sure, too, that your configure.php specifies either 'true' or 'false' for the USE_SSL definition; I've seen 1.5.5 upgrades where it's set to '' (an empty string), which can be problematic.
Yes, all checked and correct.
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
ttfan
I tried the fix cache key, did not fix it.
Tried your new code, it comes up with a blank page with just your text "trying to logoff" at the top left.
we are in the right place.... last try:
PHP Code:
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
zen_session_destroy();
unset($_SESSION['customer_id']);
unset($_SESSION['customer_guest_id']);
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
best.
-
Re: logoff page isn't redirecting properly
Didn't work :(:(:(
Here is the complete file:
Code:
<?php
/**
* logoff header_php.php
*
* @package page
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: header_php.php 5403 2006-12-27 00:38:58Z drbyte $
*/
// This should be first line of the script:
$zco_notifier->notify('NOTIFY_HEADER_START_LOGOFF');
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
/**
* Check what language should be used on the logoff screen
*/
$logoff_lang = ($_SESSION['languages_code'] != DEFAULT_LANGUAGE) ? 'language=' . $_SESSION['languages_code'] : '';
/**
* Check if there is still a customer_id
* If so, kill the session, and redirect back to the logoff page
* This will cause the header logic to see that the customer_id is gone, and thus not display another logoff link
*/
if (!empty($_SESSION['customer_id']) || !empty($_SESSION['customer_guest_id'])) {
zen_session_destroy();
unset($_SESSION['customer_id']);
unset($_SESSION['customer_guest_id']);
zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
}
// This should be last line of the script:
$zco_notifier->notify('NOTIFY_HEADER_END_LOGOFF');
?>
-
Re: logoff page isn't redirecting properly
Anyone else have any suggestions please?
-
Re: logoff page isn't redirecting properly
Did you try configuration - settings - recreate sessions - false
-
Re: logoff page isn't redirecting properly
Another is, in the directory: includes/mods/pages/logoff, how many files are present and what are their names?
-
Re: logoff page isn't redirecting properly
I assume you mean modules, not mods (in the path), as i have no mods folder?
If so, there is only one file, called header_php.php, which is the one posted above.
-
Re: logoff page isn't redirecting properly
Are there any PHP files (other than class.products_viewed_counter.php) present in your /includes/classes/observers directory?
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
lat9
Are there any PHP files (other than class.products_viewed_counter.php) present in your /includes/classes/observers directory?
Yes, there is:
class.google_recaptcha.php (which I'm actually not current using)
class.products_with_attributes_stock.php
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
ttfan
Yes, there is:
class.google_recaptcha.php (which I'm actually not current using)
class.products_with_attributes_stock.php
Would recommend removing (renaming the extension to something other than .php) both includes/auto_loaders file for recaptcha as well as the above class file starting with the auto_loader.
Not using and having the file(s) present are two different things. Wouldn't expect an issue on logout, but....
If that doesn't fix, then do the same test with the products_with_attributes files.
-
Re: logoff page isn't redirecting properly
No such google_recaptcha file in the includes.auto_loaders folder.
Can try the products_with_attributes one. Will renaming these break the shop?
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
ttfan
No such google_recaptcha file in the includes.auto_loaders folder.
Can try the products_with_attributes one. Will renaming these break the shop?
If just renaming the file(s) in the includes/auto_loaders directory, the store will operate but without the feature(s) added by the related file(s). By renaming the file(s) in the includes/classes/observers directory that do not begin with auto. there is a risk of error messages being generated.
Honestly I forget the actual action that occurs, I learned my lesson a long time ago and so install the auto_loaders type file last (if sequencing) and remove first if I want to disable something quickly.
-
Re: logoff page isn't redirecting properly
Thing is, is to briefly and quickly test if the situation is resolved. If it does not fix the situation, then restore and carry on.
Another thing to try is to work with a brand new installation on the same server then "piece-by-piece" build up to your current store and identify what action causes the problem to occur if the obvious actions that have been described don't fix it.
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
mc12345678
Thing is, is to briefly and quickly test if the situation is resolved. If it does not fix the situation, then restore and carry on.
Thank you again for the suggestion.
I tried it, still does not work.:(
How can logging out be something so tricky, when everything else is working properly, and no changes are made?
-
Re: logoff page isn't redirecting properly
Here are the server settings.... since the site was moved, this is the only thing that's changed. Are any of these settings likely to change things?
Server Host: s121.syd1.hostingplatform.net.au (103.42.110.4)
Server OS: Linux 3.10.0-714.10.2.lve1.4.79.el7.x86_64
Server Date: 05/22/2018 20:38:33
Server Up Time: 20:38:33 up 95 days, 18:26, 0 users, load average: 6.34, 6.80, 5.64
HTTP Server: LiteSpeedPHP Version: 7.0.30 (Zend: 3.0.0)
PHP File Uploads: OnUpload
Max Size: 64M
PHP Memory Limit: 128MPOST
Max Size: 64MDatabase:
MySQL 10.2.14-MariaDBDatabase
Host: localhost (127.0.0.1)
Database Date: 05/22/2018 20:38:33
Database Data Size: 53,768 kB
Database Index Size: 10,729 kB
MySQL Slow Query Log Status: On
MySQL Slow Query
Log File: s121-slow.logMySQL Mode: (None set)
-
Re: logoff page isn't redirecting properly
Can anyone else offer any suggestions... please?
-
Re: logoff page isn't redirecting properly
Quote:
Originally Posted by
Congerman
Did you try configuration - settings - recreate sessions - false
I've tried that too, didn't make a difference. :(
-
Re: logoff page isn't redirecting properly
As mention above, I'm running v1.5.5d
Below is an image of my php 7.0 settings. I wonder if one of these settings is perhaps not right?
Attachment 17868
-
1 Attachment(s)
Re: logoff page isn't redirecting properly
I'm not why it stopped displyaing in the previous post, but here it is again:
Attachment 17869
-
Re: logoff page isn't redirecting properly
v1.5.5d
PHP 7.0
Theme: responsive sheffield blue
Plugins:
Products with attributes
Google Captcha
Anyone?