If this is your first visit, check our documentation. To post, register or login.
Forums / Business Issues / Other Business Topics / zenID always present after changing http_server to https://

zenID always present after changing http_server to https://

Started by rixstix on 11 Mar 2017, 6:55 PM · Views: 1,496

Results 1 to 20 of 76
11 Mar 2017, 6:55 PM
#1
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

zenID always present after changing http_server to https://

Changed http_server to https://
ZenID is not being removed after first page visit
also first page visit is not automatically https://
all subsequent pages are https://

Suggestions for a troubleshooting starting point?
Thanks
Rick

=======================================================
includes/configure.php
change http_server from http:// to https://
define('ENABLE_SSL', 'false'); Makes no difference, tried both true and false

zenid appears in every product url until returning to homepage OR until any page other than a product page is visited.
Then the zenid is removed and never reappears.

Change http_server back to http:// and zenid is removed after the first appearance

ZC 1.5.4
php 5.6.29
mySQL 5.6.35
server OS: Linux 2.6.32-642.13.1.el6.x86_64
Westminster_New template

original zc 1.3.8a upgraded to 1.3.9 to 1.5.4

I have no reason to suspect it, but
SSL cert renewed last week
Not sure if the following was done as a result of SSL renewal or as a result of a cpanel update sometime within the past 6 months.
.htaccess modified by cpanel/apache as a requirement for autoSSL by inserting
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?$
in front of Every Individual
RewriteRule

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

11 Mar 2017, 9:26 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: zenID always present after changing http_server to https://

My first thought was to turn off ENABLE_SSL since HTTP_SERVER has an https URL in it. But you said you already tried that.

Next thought is: did you clear your browser's cookies?
Does it happen in all browsers? other PCs?
Does it happen only when not logged in?

RixStix:

also first page visit is not automatically https://
That's not a Zen Cart issue. That's up to your server's configuration for your domain.
You can add some .htaccess rewrite rules to translate any non-https page to https first.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Mar 2017, 10:39 PM
#3
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

DrByte:

Next thought is: did you clear your browser's cookies?
Yes. Chrome, FireFox

DrByte:

Does it happen in all browsers? other PCs?
FireFox, Chrome & Edge. All react the same.
Same for Desktop, laptop, Motorola Android Phone and Samsung Tab S2 Android tablet,

DrByte:

Does it happen only when not logged in?
Same whether logged in or not logged in. zenID remains visible in the URL as long as products are clicked. First visit to a non-product page (HOME, definepage or ezpage) causes the zenID to be removed from the URL.

DrByte:

That's not a Zen Cart issue. That's up to your server's configuration for your domain.
You can add some .htaccess rewrite rules to translate any non-https page to https first.
I am not losing sleep over that. I did see the .htaccess thread yesterday but didn't want to start making changes for multiple issues at the same time.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

11 Mar 2017, 11:32 PM
#4
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

I was just toggling things false/true and

Admin
Configuration
Sessions
Force Cookie Use (Change default False to True)

zenID now is removed as expected and the same as when http_server was http://

That in itself tells me nothing other than it seems to work now but is changing that setting (from false to true) going to affect something else up down the road?

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

12 Mar 2017, 9:06 PM
#5
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

That didn't work. Significant NEGATIVE effect is that Auth.net SIM does not function as expected with the switch set to TRUE.

Back to square 1 in the quest to figure out why suddenly the zenID is not removed from the URL until a non product URL is visited, on my store.

RixStix:

I was just toggling things false/true and

Admin
Configuration
Sessions
Force Cookie Use (Change default False to True)

zenID now is removed as expected and the same as when http_server was http://

That in itself tells me nothing other than it seems to work now but is changing that setting (from false to true) going to affect something else up down the road?

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

13 Mar 2017, 5:54 AM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: zenID always present after changing http_server to https://

While I don't know what all rewriteRules are present or what they do, but the additional rewriteCond "pair" appear to prevent a rewriteRule from being activated if the request_uri has that content on it. It's as if there is something else that is expected to handle that information if it is provided. I mean if the rules were well coordinated/documented then a single skip rule could be used up front to skip however many rules that follow if that one set conditions were met. I think the last time I used something like that to skip too many rules, an error was logged with the server as well, so it could become an issue if incorrectly used/entered.

Just thought I would step in with that one. Otherwise, I know there were some changes made to html_output.php in 1.5.5. Was trying to reread the thread but has change of template had an effect? As to making all of the various testing changes above, had the session expired or forced to between each test of a different condition?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Mar 2017, 11:33 AM
#7
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

RixStix:

I have no reason to suspect it, but
SSL cert renewed last week
Not sure if the following was done as a result of SSL renewal or as a result of a cpanel update sometime within the past 6 months.
.htaccess modified by cpanel/apache as a requirement for autoSSL by inserting
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?$
in front of Every Individual
RewriteRule

Here's a thought. Get rid of those two RewriteCond rules, for cpanel and Comodo. See how your site works. If the the ZenID problem was related to rules in your .htacces file it should be gone.

Then put this at the top of your .htaccess file, removing any lines futher in the file that may duplicate these rules.

########################
#  Default Settings
########################
Options  +SymLinksIfOwnerMatch -FollowSymlinks -Indexes

RewriteEngine ON

# if you want all pages to use an https URL
# anytime an https URL is not used then redirect to use https
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]

# regardless of whether an https URL is used,
# if a URL is used that includes www then redirect to an https URL that does not use www
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R,L]

If your site does use www in the URL, then reverse the second rule.

The learning is in the doing.

Potent Products

13 Mar 2017, 2:08 PM
#8
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

While I have not digested mc12345678 and Website Rob comments yet,

Adding to .htaccess

#RewriteEngine On
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://chainweavers.com/$1 [R,L]

Does cause the first page to always be https://, it also prevents zenID from ever, ever being removed from the URL.
Without the above, at least the zenID is removed after visiting a non product page.

Now to digest the other comments.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

13 Mar 2017, 2:37 PM
#9
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

I copied the .htaccess snippet in my post immediately above after I had commented the lines.

I am not sure the .htaccess lines added by cPanel can be removed, or IF they are removed, that they will not be automatically reinserted by cPanel.
A google search using either on of those lines yields more results than I care to read, but it is related to autoSSL and there is a specific, documented reason that the lines are added at each occurrance of a rewrite rule.

cpanel considers

we (cPanel) have always classified .htaccess files as part of Apache configuration files, which means we (cPanel) can/should manage them. This conversation (on why the heck cPanel is adding lines) has definitely helped us (cPanel) to understand how customers view the .htaccess files: as part of their website content, rather than as a server configuration file.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

13 Mar 2017, 3:00 PM
#10
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

Website Rob:

Here's a thought. Get rid of those two RewriteCond rules, for cpanel and Comodo. See how your site works. If the the ZenID problem was related to rules in your .htacces file it should be gone.

Restored .htaccess from a previous backup which did not contain the cpanel/comodo inserts.
No difference.
zenID still appears appended to product URLs until a non-product URL is visited. From that point on, zenID does not appear appended to the URL.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

13 Mar 2017, 3:25 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: zenID always present after changing http_server to https://

RixStix:

Restored .htaccess from a previous backup which did not contain the cpanel/comodo inserts.
No difference.
zenID still appears appended to product URLs until a non-product URL is visited. From that point on, zenID does not appear appended to the URL.

To confirm with this, if two products are visited back-to-back that also does not do the same as visiting a product and then visiting a non-product?

And saying that immediately when visiting the non-product that the url at that page is missing the zenid and further links from that page do not have it either?

Do you have any includes/init_includes/overrides files? What about includes/autoloaders/overrides files?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Mar 2017, 3:45 PM
#12
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

mc12345678:

To confirm with this, if two products are visited back-to-back that also does not do the same as visiting a product and then visiting a non-product?

And saying that immediately when visiting the non-product that the url at that page is missing the zenid and further links from that page do not have it either?

Do you have any includes/init_includes/overrides files? What about includes/autoloaders/overrides files?

Yes, first page visited never has a zenID appended to the URL. Next page visited = product page = has zenID appended to URL. Keep visiting product pages and zenID is still appended. Then, visit a non-product page, including homepage, zenID is now removed. Next visit any product page and zenID is no longer appended to the URL.

If 2nd page visited is a non product page, no zenID appended to URL. Next visit a product page, no zenID is appended.

It seems as though it takes a visit to a non product page to cause the removal of the zenID from the URLs when the http_server is set to https://

mc12345678:

Do you have any includes/init_includes/overrides files? What about includes/autoloaders/overrides files?

No init_includes/override files
No autoloaders/override files

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

13 Mar 2017, 3:54 PM
#13
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: zenID always present after changing http_server to https://

Not sure of the current setup, but just moments ago navigated the site. The first time I visited it at the root of the store, I could see that zenid was going to be present. Navigated to login, it was there, then navigated to category, disappeared as expected. Using a new "browser" I could again see that zenid was going to be present, tried to follow same path but without removal of zenid.

Now navigated to product, switched products even tried to go back to a category, not seeing the removal of the zenid. The only time I am now seeing the zenid get/stay removed is by going to the main page (which is a link constructed of HTTP_HOST . DS_WS_CATALOG ) and not from a link generated with zen_href_link, or if I manually remove it from the uri and submit the uri without it.

If not mistaken, this is supposed to happen in includes/functions/html_output.php, so curious how the zen_href_link function in your version is different from a default version for ZC 1.5.4.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Mar 2017, 4:36 PM
#14
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

html_output.php

Is zc1.5.4 default with the addition of a bugfix from 11Nov2015 related to failed customer login/password

Re: my tests using non product pages = ezpages, definepages, homepage. Cart/checkout/login pages are as you experienced

I have to go do some real work, so will be out of pocket for a few hours. TNX for any/all suggestions.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

13 Mar 2017, 5:37 PM
#15
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: zenID always present after changing http_server to https://

Shucks, so won't be easy to provide the contents of zen_href_link as they currently are on the site I take it.

Also, the rules for the htaccess, it might be of benefit to see the rewriteRule statements in the order that they are provided in the file to see if there is any transition statements that may be causing a conflict to suggest to the software that there is a need to put the zenid back on.

Or perhaps there is php directive that has something to do with it, I'm not yet sure.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Mar 2017, 5:44 PM
#16
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

RixStix:

Restored .htaccess from a previous backup which did not contain the cpanel/comodo inserts.
No difference.
zenID still appears appended to product URLs until a non-product URL is visited. From that point on, zenID does not appear appended to the URL.

You didn't mention if you applied the new .htaccess rules I provided.

The learning is in the doing.

Potent Products

13 Mar 2017, 7:08 PM
#17
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

Website Rob:

You didn't mention if you applied the new .htaccess rules I provided.

No I did not apply them. I took the comment to mean "Apply these rules if removing the cpanel comodo rules had an effect".

I just eliminated server root .htaccess and that made no difference.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

29 Mar 2017, 4:44 PM
#18
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

Still trying to find the cause

Latest testing shows
Product pages or any other page visited via a link in the template Mega-Menu keeps the zenID until a page is visited via a footer link or sitemap link.
Product pages visited via a sitemap link never show the zenID

ie: From homepage, visit any product, category or customer service page accessible from the Mega-Menu and the zenID appears every time.

Visit the same product, category or customer service page via the sitemap, the zenID is removed if it was present or is never shown if the first page after the homepage is visited via a footer or sitemap link. After this, any page visited via the Mega-Menu no longer has the zenID.

So, my thinking is that the issue is caused by the Westminster_New template and/or Mega-Menu used by the template. Either way, Anne, Pica-fluor Azul, has been noticeably absent from template support threads.

Ideas? I can't do testing using my sandbox sites because they do not have SSL certs.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

29 Mar 2017, 7:42 PM
#19
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

Suggest fixing some the HTML code used as a quick code validation check showed more than a few errors. Interesting thing is that there are a lot &amp that are missing a closing ; which is somewhat related to the problem you are experiencing. And if not related, always good to have correct code whenever possible.

The learning is in the doing.

Potent Products

29 Mar 2017, 7:50 PM
#20
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

TNX. We'll start working on that. AND try to slap the hand of the typer to prevent future occurances. :smile:

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com