If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading from 1.3.x to 1.3.9 / Users cannot login after upgrade - "There was a security error when trying to login"

Users cannot login after upgrade - "There was a security error when trying to login"

Locked

Started by rob_chevalier on 1 Jan 2008, 7:28 AM · Views: 9,649

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
1 Jan 2008, 7:28 AM
#1
rob_chevalier avatar

rob_chevalier

New Zenner

Join Date:
Dec 2007
Posts:
5
Plugin Contributions:
0

Users cannot login after upgrade - "There was a security error when trying to login"

I just upgraded from 1.3.7 to 1.3.8 and have just noticed that existing users cannot login. Message:
"There was a security error when trying to login."

I can create new user profiles just fine and I can even use the "forgot password" option to generate a new password which gets emailed successfully. Using the new password still results in the same error message.

Thought, tips?

Thanks,

Rob Chevalier

1 Jan 2008, 10:02 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Users cannot login after upgrade - "There was a security error when trying to login"

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

1 Jan 2008, 1:33 PM
#3
bdcreations avatar

bdcreations

New Zenner

Join Date:
Feb 2007
Location:
Canada
Posts:
83
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

I have also read the tutorial a million times now, still had no idea how to merge the 2 files and cannot find the security token line that needs to be changed...I think I have accidentally over written it...

What is the line so I can add it back in??? Can someone please paste it for me and its lcation it needs to be in the 2 files please?

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

Thanks!!

Our ZenCart online store www.bydesigncreations.ca

"The more you know the less you understand."

1 Jan 2008, 5:19 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Users cannot login after upgrade - "There was a security error when trying to login"

Fire up WinMerge and drag-and-drop your customized version of tpl_timeout_default.php onto WinMerge. Then drag-and-drop the template_default version of the same file into the "right" field that is now showing in WinMerge.
Click OK.

You'll see all the differences highlighted for you.
You can copy/paste from one file to the other, or even use the built-in controls to copy certain sections from right-to-left or vice-versa depending on what you need to accomplish.

Repeat with as many files as necessary for what you need to do.

When done merging the new pieces into your custom template file(s), be sure to upload the changes to your server.

You can also drag-and-drop entire folders into WinMerge in the same fashion. It will show you the differences of all files and folders and let you merge components as needed.

If you aren't running Windows, there are some alternative Diff tools besides WinMerge which you may find useful: http://www.zen-cart.com/forum/showthread.php?t=7330

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

1 Jan 2008, 6:24 PM
#5
bdcreations avatar

bdcreations

New Zenner

Join Date:
Feb 2007
Location:
Canada
Posts:
83
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

As I thought I mentionned I think I have already overwritten the new file with my original as they are both already identical and there is no mention of security token anywhere in file!!

I need to know the line of code for the security token to add it back in...or now what??

DrByte:

Fire up WinMerge and drag-and-drop your customized version of tpl_timeout_default.php onto WinMerge. Then drag-and-drop the template_default version of the same file into the "right" field that is now showing in WinMerge.
Click OK.

You'll see all the differences highlighted for you.
You can copy/paste from one file to the other, or even use the built-in controls to copy certain sections from right-to-left or vice-versa depending on what you need to accomplish.

Repeat with as many files as necessary for what you need to do.

When done merging the new pieces into your custom template file(s), be sure to upload the changes to your server.

You can also drag-and-drop entire folders into WinMerge in the same fashion. It will show you the differences of all files and folders and let you merge components as needed.

If you aren't running Windows, there are some alternative Diff tools besides WinMerge which you may find useful: http://www.zen-cart.com/forum/showthread.php?t=7330

Our ZenCart online store www.bydesigncreations.ca

"The more you know the less you understand."

1 Jan 2008, 7:06 PM
#6
drbyte avatar

drbyte

Sensei

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

Re: Users cannot login after upgrade - "There was a security error when trying to login"

BDCreations:

As I thought I mentionned I think I have already overwritten the new file with my original as they are both already identical and there is no mention of security token anywhere in file!!

I need to know the line of code for the security token to add it back in...or now what??

Fair enough.
So ... in order to find the exact lines of code if I were to look them up for you, I would do the following:

  • find a fresh copy of the original files (perhaps download fresh again from Zen Cart site, or maybe re-unzip the files you downloaded previously)
  • open the original version in WinMerge
  • open the customized version in WinMerge
  • compare and identify the different lines.

In case you're uncertain where to download the latest version of Zen Cart original files, click the "home" link at the top of this page. You'll see the "download now" button and text on the right-hand side of the screen.

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

1 Jan 2008, 9:46 PM
#7
bdcreations avatar

bdcreations

New Zenner

Join Date:
Feb 2007
Location:
Canada
Posts:
83
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

That's so awesome - it worked..so only one major problem left...cart does not checkout...back to that thread to see where to go from there!!

Thanks a mint...apologies for seeming dumb - I normally am not this bad...lol

Moy

DrByte:

Fair enough.
So ... in order to find the exact lines of code if I were to look them up for you, I would do the following:

  • find a fresh copy of the original files (perhaps download fresh again from Zen Cart site, or maybe re-unzip the files you downloaded previously)
  • open the original version in WinMerge
  • open the customized version in WinMerge
  • compare and identify the different lines.

In case you're uncertain where to download the latest version of Zen Cart original files, click the "home" link at the top of this page. You'll see the "download now" button and text on the right-hand side of the screen.

Our ZenCart online store www.bydesigncreations.ca

"The more you know the less you understand."

1 Jan 2008, 10:12 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Users cannot login after upgrade - "There was a security error when trying to login"

BDCreations:

That's so awesome - it worked..

Glad it worked.
That's why the WinMerge instructions were made part of the Upgrade instructions which are published with Zen Cart in the /docs/ folder and available online in this FAQ: https://www.zen-cart.com/tutorials/index.php?article=108

Now ... taking it one step further ... did you run WinMerge to compare all your customized files vs the originals? Technically that's the first step you need to do when doing a site upgrade (after making backups of course).

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

1 Jan 2008, 10:46 PM
#9
bdcreations avatar

bdcreations

New Zenner

Join Date:
Feb 2007
Location:
Canada
Posts:
83
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

Now ... taking it one step further ... did you run WinMerge to compare all your customized files vs the originals? Technically that's the first step you need to do when doing a site upgrade (after making backups of course).

What directories do I need to be comparing EXACTLY?? I used the "simply-zen" template..that directory/subdirectories??

Our ZenCart online store www.bydesigncreations.ca

"The more you know the less you understand."

6 Jan 2008, 6:54 AM
#10
rob_chevalier avatar

rob_chevalier

New Zenner

Join Date:
Dec 2007
Posts:
5
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

D'oh! I hadn't merged the changes in the login script to my template version. I could have sworn I had checked that one too. sigh.

Indeed, WinMerge is a blessing.

Thanks!,

-r

7 Jan 2008, 8:24 AM
#11
jcgkiwi avatar

jcgkiwi

New Zenner

Join Date:
Feb 2007
Posts:
19
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

3 cheers for DrByte :clap:

I had the same problem... thanks to this thread it is solved, but thought I'd add my 2 cents worth!

I noticed the date in my download of 1.3.8a the default template version of tpl_login_default.php has a date stamp (28 Feb 07) older than the one I had on the site (from ver 1.3.7.1?). So even though I hadn't customised the file, I guess it got skipped during the upgrade - even though I told the ftp to overwrite "newer" files.

Long story short... I copied the file over again - it now works!
I hope there are no others that got skipped!!! :blink:

Jon

9 Mar 2008, 4:36 AM
#12
bjordan avatar

bjordan

New Zenner

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

Re: Users cannot login after upgrade - "There was a security error when trying to login"

DrByte:

Fire up WinMerge and drag-and-drop your customized version of tpl_timeout_default.php onto WinMerge. Then drag-and-drop the template_default version of the same file into the "right" field that is now showing in WinMerge.
Click OK.

You'll see all the differences highlighted for you.
You can copy/paste from one file to the other, or even use the built-in controls to copy certain sections from right-to-left or vice-versa depending on what you need to accomplish.

Repeat with as many files as necessary for what you need to do.

When done merging the new pieces into your custom template file(s), be sure to upload the changes to your server.

You can also drag-and-drop entire folders into WinMerge in the same fashion. It will show you the differences of all files and folders and let you merge components as needed.

If you aren't running Windows, there are some alternative Diff tools besides WinMerge which you may find useful: http://www.zen-cart.com/forum/showthread.php?t=7330
Thanks for the information. I was having the same problem as everyone else.

24 Mar 2008, 8:26 PM
#13
studio805 avatar

studio805

New Zenner

Join Date:
Mar 2008
Posts:
1
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

I downloaded the Winmerge... have both files side by side and EVERYTHING is different! :(

11 Apr 2008, 9:42 AM
#14
devis avatar

devis

New Zenner

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

Re: Users cannot login after upgrade - "There was a security error when trying to login"

Solution is very easy and described here: https://www.zen-cart.com/tutorials/index.php?article=312

Just insert this code in "tpl_login_default.php" and "tpl_time_out_default.php" in your template:

<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>

after every occurence of the password field (zen_draw_password_field function)

bye
Devis Lucato

Web software developer
Italy

29 May 2008, 5:07 PM
#15
cindyrelly avatar

cindyrelly

New Zenner

Join Date:
May 2008
Location:
Central FLA USA
Posts:
10
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

I just took over as webmaster for a site that's current version is Zen Cart 1.3.8a and I am an absolute novice with Zen Cart and php [ although somewhat coherent with cgi, javascript, html and css ].

Many users [ including my test account ] are getting the error message, "There was a security error when trying to login." However, if I just click the login button again I'm IN. What the heck??

This site has a custom template but the files I'm supposed to update are non-existant in the folders:

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

I tried on a whim to just put copies of the tpl_login_default.php and tpl_timeout_default.php files in the default directory but of course that didn't work! That would be too easy.

I guess I should ask the site owner if she happens to have the original set of custom template files and maybe those particular files have somewhere along the way been deleted but other than that I am totally out of ideas and frustrated at this point.

Any advice would be truly, greatly welcomed! ;)

Cindyrelly

2 Jun 2008, 7:01 PM
#16
ph0ngvu avatar

ph0ngvu

New Zenner

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

Re: Users cannot login after upgrade - "There was a security error when trying to login"

All you need to do is add this new Security Feature to 2 files tpl_login_default.php and tpl_time_out_default.php

Find the text "<label class="inputLabel" for="login-password"><?php echo ENTRY_PASSWORD; ?></label>" in both file tpl_login_default.php & tpl_time_out_default.php and add "<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>"

below the "<br class="clearBoth" />" (2-3 lines under)

That will do the trick.

2 Jun 2008, 11:40 PM
#17
stflats avatar

stflats

New Zenner

Join Date:
Apr 2007
Posts:
81
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

Thanks... It took me a few to understand what was being said here but I finally got it. And yes, The WinMerge program is so worth having.

For all of you extreme novices out there (such as myself) I didn't understand what was being explained here but now I do. It was the use of the phrase "customized" that was throwing me for a loop. Basically, they are (and please Dr. correct me if I am wrong) referring to custom templates, not necessarily files that you have 'customized.' So do this >>> download winmerge... Install it then open it.

Go to:
your_shop\includes\templates\template_default\templates\

and from there find the php file:

your_shop\includes\templates\template_default\templates\tpl.login.default.php

Drag this file into winmerge. A little window will pop up giving you the option to browse for the second file that will be compared to the one you just dragged in. Using the browse button (I assume there are other ways, just saying what I did) go to your CUSTOM TEMPLATE FOLDER and get this file:

urteeshop\templates\tpl.login.default.php

Select this file and hit OK. The program will bring up both pages side by side and will highlight the lines that are different between the two. All I did from here was select the Merge tab at the top of the page and told it to Copy To Right. That told it to take the information in the Left page (the zen cart 1.3.8a file) and copy it to the Right page, filling in and correcting the missing elements.

Then, do the same for the tpl.timeout.default.php files (same pathways) and merge the info on the Left page to the Right page.

Then, upload the newly altered files from your CUSTOM TEMPLATE and upload it to its same location on your server and that should do it... Well, it did it for me. If this is wrong, I am sure the good Doctor will correct me. But again, it was the use of the word "customized" that was throwing me...

Good luck

3 Jun 2008, 5:30 PM
#18
cindyrelly avatar

cindyrelly

New Zenner

Join Date:
May 2008
Location:
Central FLA USA
Posts:
10
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

ph0ngvu:

All you need to do is add this new Security Feature to 2 files tpl_login_default.php and tpl_time_out_default.php

Find the text "<label class="inputLabel" for="login-password"><?php echo ENTRY_PASSWORD; ?></label>" in both file tpl_login_default.php & tpl_time_out_default.php and add "<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>"

below the "<br class="clearBoth" />" (2-3 lines under)

That will do the trick.

I Really do appreciate your advice and I sat down and looked through those files. However, that code is already in there for the security token and in the correct place so I'm back to square One! Oh, well, at least now I am more familiar with those files ;)

Cindyrelly

4 Jun 2008, 10:29 AM
#19
heidikfi avatar

heidikfi

New Zenner

Join Date:
Mar 2005
Location:
Finland
Posts:
64
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

Same problem here. I haven't changed any of that code, but get occasional errors both in admin and shop at login. Just click login again, and I'm in.

Server OS: Linux 2.6.9-67.0.7.ELsmp Database: MySQL 4.1.22-standard
PHP Version: 5.2.6 (Zend: 2.2.0)
ZC version 1.3.8a

Marianne in Finland

9 Jun 2008, 7:04 PM
#20
realforever avatar

realforever

New Zenner

Join Date:
Jul 2006
Posts:
58
Plugin Contributions:
0

Re: Users cannot login after upgrade - "There was a security error when trying to login"

I have the same problem after the SSL installed with my existing 1.3.8 a.

I also checked and not found the two files after my template. Copied the file from template_default over is not working either as Cindy pointed out.

My question is the instruction here specified as ```
"below the "<br class="clearBoth" />" (2-3 lines under)"