This Zen Cart tutorial discusses a rather serious error message, which reads ‘There was a security error when trying to login’. What makes this error message so alarming is the fact that it is sometimes encountered by customers attempting to log into their accounts on your website. It’s easy to see why many store owners who experience this issue want to resolve it as quickly as possible.
Before you get too worried about this message and it’s potential repercussions, however, you should probably know that this error can be generated by user error on your customer’s end. If a zen cart log in page is left sitting for upwards of around 20 minutes,the background security token for the page will expire, and customers will be unable to login until they reload the page. So, if you are getting a complaint about this error, especially if it is an isolated incident, advise your customer to reload their web page. Nine times out of ten, this will resolve the issue immediately.
This error message could also result from something more serious, however, like a coding issue(Mismatched beginning/ending tags, incorrect syntax, misspellings, etc.). If this error is popping up often on your website, you should review any recent customizations you have made to your website to ensure that there are no mistakes in the code you added/modified.
It should also be noted that this error can be generated due to missing or incorrect information stemming from the /includes/functions/sessions.php file. It is very rare that this file will need to be edited, but if you must make customizations to this file, make sure that you merge your changes to this file into the old version rather than replacing it altogether.