There was a security error when trying to login

Situation:

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

Cause:

Zen Cart has a security feature to prevent spoofed external logins. A "security token" field must exist on all login forms, actually on all forms submitting data via POST. This token must be current (not expired),
and must be submitted with the rest of the form data; in the case of login, that would be the login username+password in order for logins to work properly.


Remedy:

All your forms, both admin and non-admin, need to use zen_draw_form() instead of hard-coding a <form> tag.


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.

Other Considerations:

If you're seeing this problem then one of the following may be the problem:
- old obsolete template files, as explained above
- your browser is unable to set session cookies, or you're using Private Browsing mode
- you're using Chrome as a browser and it's having troubles negotiating a session properly
- you've set your site up on an IP address instead of a domain name, thus preventing session cookies from being set properly
- your PHP configuration can't negotiate sessions properly- Your server's PHP configuration has session.use_only_cookies set to 1. It needs to be 0. Have your hosting company fix it.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How can I find out what version of Zen Cart or PHP or MySQL I'm using?

To find out what version of Zen Cart or PHP or MySQL you are currently using, you can simply go...

Getting a BLANK PAGE? Here's the answer ...

If you're getting a blank page when trying to browse to a certain page on your store, or after...

What's New in the Upcoming v2.0 release?

Database Abstraction Layer and Sql CacheThe abstraction layer has been re-factored to include a...

Image Preparation - How-to

I've seen several posts where people obviously aren't quite sure about the best way to set up...

Some tips to modify stylesheet

1. Download Web Developer extension for FireFox here2. Install & restart FireFox. You should...