Forums / Basic Configuration / There was a security error when trying to login

There was a security error when trying to login

Locked

Started by asterix on 4 Jan 2008, 4:48 AM · Views: 9,455

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
4 Jan 2008, 4:48 AM
#1
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

There was a security error when trying to login

I have an issue with not being able to log in after creating an account ("There was a security error when trying to login"). I did a full 3.8 install and updated the necessary files to 3.8a.

When I create an account, I can successfully place an order but I cannot log back in after logging off, even using the "forget password" feature.

Where should I look?

4 Jan 2008, 5:32 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: There was a security error when trying to login

This issue is discussed in the following tutorial. It's related to customized files in your template:
https://www.zen-cart.com/tutorials/index.php?article=312

Related thread:
http://www.zen-cart.com/forum/showthread.php?t=84197

.
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.

4 Jan 2008, 12:48 PM
#3
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Re: There was a security error when trying to login

Looks like that was it. Thanks again! :)

12 Feb 2008, 2:30 PM
#4
scrapdragondesigns avatar

scrapdragondesigns

New Zenner

Join Date:
Mar 2007
Posts:
25
Plugin Contributions:
0

Re: There was a security error when trying to login

Situation:

I have just upgraded and now getting this error when trying to login from the customer screen "There was a security error when trying to login"

Cause:

Zen Cart™ v1.3.8 has an added security feature to prevent spoofed external logins. A "security token" field has been added to all login forms. This token must be current (not expired), and must be submitted with login username+password in order for logins to work properly.

Remedy:

If you have customized template "login" files, the new security features need to be merged into your customized template files.

The following files are affected:

  • /includes/templates/YOUR_TEMPLATE/templates/tpl_login_default.php
  • /includes/templates/YOUR_TEMPLATE/templates/tpl_timeout_default.php

And if you're encountering it in your Admin area, this file is affected as well:

  • /admin/login.php

Additionally, if you have customized your /includes/functions/sessions.php file for some reason, you'll also need to merge the new changes for this core file into your customized version.

I am getting this error message when trying to login to the store admin. I have tried logging in as a customer and all seems fine. I raised the issue as a support ticket with my web hosting but they have only reached the above point with me so far. Obviously, the first part of this relates to customers and I didn't customise those files anyway.

However, even though I didn't customise this file
And if you're encountering it in your Admin area, this file is affected as well:

  • /admin/login.php
    I am guessing this is what is causing the problem
    Trouble is, I can't find the file to look at it or amend it!

Any help is appreciated and please remember when replying that I am stupid - therefore you need to explain things in simple terms, lol.

Other useful info,,, my web host has changed my password so many times I have no idea what it is anymore!
this was not a full install, but I upgraded through my web host cpanel (fantastico)

12 Feb 2008, 3:26 PM
#5
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: There was a security error when trying to login

I am getting this error message when trying to login to the store admin. I have tried logging in as a customer and all seems fine
What do you mean? How can you login in as customer on store admin?

Did you try to copy admin/login.php from the download package, and upload it to your server?

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

12 Feb 2008, 3:58 PM
#6
scrapdragondesigns avatar

scrapdragondesigns

New Zenner

Join Date:
Mar 2007
Posts:
25
Plugin Contributions:
0

Re: There was a security error when trying to login

Sorry, I wasn't very clear. I have been reading the forum and it seems a lot of people have a similar error but with regard to customer login. I have a customer account in my store and I logged into that and logged out and in again and didn't have any problems.

However, I can't get into the admin area at all. I finally located the admin/login file and have downloaded it, but I can't for the life of me see what I need to change on it. I didn't customise any of these files in the first place and I don't want to make things worse by changing anything when I don't know what I'm doing.

No, I didn't copy any file and upload, I just clicked the upgrade button in fantastico, then I reuploaded all the customised files

I just need to over-ride this security thing
TIA

12 Feb 2008, 4:02 PM
#7
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: There was a security error when trying to login

If you didnt customize the admin side, you can safely download the 1.3.8a package, then upload that admin/login.php file to your server, overwrite the current one.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

12 Feb 2008, 9:49 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: There was a security error when trying to login

ScrapdragonDesigns:

this was not a full install, but I upgraded through my web host cpanel (fantastico)

Number one lesson ... don't do that !
Fantastico's upgrader is not reliable and should not be used.
A manual upgrade is always the recommended approach.

.
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.

14 Feb 2008, 4:44 PM
#9
mooncavecrystals avatar

mooncavecrystals

Zen Follower

Join Date:
Sep 2006
Posts:
455
Plugin Contributions:
0

Re: There was a security error when trying to login

ok, bear with me cause I am stupid too :) I upgraded as well and am having the log in error. So...what you are saying is to use winmerge and put the files side by side ...my customized and the newest version of the zen file. Then i take the yellow highlighted new zen files and copy and paste them to the customized file. Then reupload??

This stuff scares me to death :) thanks for taking the time to verify this for me :)

28 Feb 2008, 5:59 AM
#10
pillaroom avatar

pillaroom

New Zenner

Join Date:
Feb 2008
Posts:
27
Plugin Contributions:
0

Re: There was a security error when trying to login

Okay Dr Byte. This is going to sound insane, but I am hoping that you can help me. When I went to test my customer login it returned the security error mentioned above. After reading the posts I figured that the issue had to lie in tpl_login. The thin that is different about my situation is that I did a clean install of 1.3.8a. Not an upgrade. But because nothing else seemed to work I compared a new 1.3.8a tpl_login file with the one on my site using WinMerge. It turns out that the login file that was at my site was copyright 2006. The new one was 2007. I copied the new files over and it all works fine.

Here's my problem. How did the old tpl_login get there? One other material fact. Up until I added Google Checkout the login worked fine.

Any thoughts? Am I just insane?
Brad

28 Feb 2008, 8:53 PM
#11
drbyte avatar

drbyte

Sensei

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

Re: There was a security error when trying to login

pillaroom:

Okay Dr Byte. This is going to sound insane, but I am hoping that you can help me. When I went to test my customer login it returned the security error mentioned above. After reading the posts I figured that the issue had to lie in tpl_login. The thin that is different about my situation is that I did a clean install of 1.3.8a. Not an upgrade. But because nothing else seemed to work I compared a new 1.3.8a tpl_login file with the one on my site using WinMerge. It turns out that the login file that was at my site was copyright 2006. The new one was 2007. I copied the new files over and it all works fine.

Here's my problem. How did the old tpl_login get there? One other material fact. Up until I added Google Checkout the login worked fine.

Any thoughts? Am I just insane?
Brad

Perhaps when you added the Google Checkout one of its files busted things?
Perhaps not adding Google Checkout might be the answer? Or maybe you used the wrong version of GC files?
Or maybe asking for help in the Google Checkout support forum might be more effective?

.
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.

5 Mar 2008, 5:37 PM
#12
mooncavecrystals avatar

mooncavecrystals

Zen Follower

Join Date:
Sep 2006
Posts:
455
Plugin Contributions:
0

Re: There was a security error when trying to login

ok, I still get a security error when trying to login into my admin. However, if I login again, it let's me in.

I did a fresh install of 1.3.8 and then used my backup database, so the admin/login.php, when comparing it old copy to new is updated. Is there somewhere else I should be looking?

5 Mar 2008, 6:03 PM
#13
drbyte avatar

drbyte

Sensei

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

Re: There was a security error when trying to login

mooncavecrystals:

ok, I still get a security error when trying to login into my admin. However, if I login again, it let's me in.

Is this happening on a fresh visit to the login page, or after it's sat open in a window for an extended period of time untouched?

The security token on the page expires after a period of time and requires regeneration after expiry ... thus the need to "login again" as you put it.

.
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.

5 Mar 2008, 6:09 PM
#14
mooncavecrystals avatar

mooncavecrystals

Zen Follower

Join Date:
Sep 2006
Posts:
455
Plugin Contributions:
0

Re: There was a security error when trying to login

Ah! that could be it......since I usually keep my zen cart open most all the time....either doing work or seeing who is shopping and such. I will pay more attention and see if it is ME that is causing my paranoia :)

thanks DrB :clap:

3 Apr 2008, 6:12 PM
#15
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: There was a security error when trying to login

Dr. Byte - not meaning to double post - but Kim set me on a search for recent info that might be related to my issue (you can see my original post here - http://www.zen-cart.com/forum/showthread.php?p=534871#post534871

To keep my question short - can't login if I use www in config settings - remove it and I can login. Pretty ugly with SSL.

3 Apr 2008, 7:58 PM
#16
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: There was a security error when trying to login

Just a quick note - issues solved.

Thanks

16 Apr 2008, 11:21 PM
#17
dhyatt avatar

dhyatt

New Zenner

Join Date:
Apr 2008
Posts:
2
Plugin Contributions:
0

Re: There was a security error when trying to login

That tutorial did the trick for me too! :clap:

4 Jun 2008, 6:24 PM
#18
webchills avatar

webchills

Zen Follower

Join Date:
Sep 2005
Location:
Austria
Posts:
99
Plugin Contributions:
1

Re: There was a security error when trying to login

DrByte:

This issue is discussed in the following tutorial. It's related to customized files in your template:
https://www.zen-cart.com/tutorials/index.php?article=312

Related thread:
http://www.zen-cart.com/forum/showthread.php?t=84197

I had this issue too, was using a customized tpl_login_default and have fixed it thanks to this excellent tutorial.
But I have noticed that sometimes you get the security message when using the sidebox login sidebox for the login. Sometimes you can login, sometimes not.
I' ve checked the code in the latest login box version from
http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_52&products_id=154
and the code

$content .= zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);

is included.
But sometimes you get the security message, sometimes it works.
Any ideas why the login box is not working reliable in 1.3.8a?