Jump to content

Invalid Security Token


Recommended Posts

  • 1 month later...
  • 1 month later...

I just came across a similar issue in the Tools->Tabs menu when trying to use the "reset" and "filter" options. Looking at the code, the issue is that there is a GET/POST value called "token" which is normally embedded into URLs and forms, presumably for some sort of access control (haven't dug that far yet). When this error shows up it means that the action you took did not pass along the token value.

Most likely this is a Prestashop bug where one of the page controls is not embedding the token value.

I fixed this for the Tabs module by adding in the missing form value in the relevant class file AdminTabs.php:

<input type="hidden" name="token" value="',$this->token,'" />

Something similar is likely needed in your case.

Cheers

Link to comment
Share on other sites

  • 1 month later...

I have the same problem...any chance someone can help us?

So far any of the answers provided in the forum don't work for my issue so maybe some else has run in to this and can help.


In the catalog section, only some products are still showing and if you hit filter or reset you get the Invalid security token error.

when choosing products within a category, it may say you have 4 products but only 3 are showing. If you click the arrows to get to the next page, you get Invalid security token.

Slater

Link to comment
Share on other sites

From what I got back in a bug report I made, it sounds like the Admin control panel "catalog" section filtering options may be fixed in the 1.3.* beta version. I would suggest giving that a try first to see if it fixes the issue for you. If it doesn't, it is going to be very difficult to say what is going wrong in your case without detailed steps to recreate it (screenshots would help).

The "bad token" error message is a generic one so it is possible that your problem is the not the same as the original poster's.

Cheers

Link to comment
Share on other sites

Ok, I've upgraded to the new beta version and all looked good until I got an email from my client that as she was updating product info the she again received the invalid security token.

In the catalog area if you click on reset or filter or next page, we get the error. It says 76 products in category but only 3 or 4 showing.

The beta was supposed to fix that error was it not?

How can I fix this so she can bring her cart live?

Thanks

Link to comment
Share on other sites

  • 2 months later...

I have found a way to clear the error - if you delete all cookies it works again. Not sure its much of a solution, especially if its the customer who's getting the problem on the front end. It might help anyone getting stuck in the back end though.

I've been evaluating Prestashop for a new site and keep getting this error on the default install which is worrying me.... I'd be v interested in any solution coz otherwise I just can't go with it!

Link to comment
Share on other sites

Honestly IrishGal, I never did receive help on this one. One of the programmers did come forward and was able to re-produce the results I was getting but never followed through with fixing it nor did he ever respond again.

I just ended up going back to the 1.1.0 version which seems to be more stable as my client was getting antsy. With security warnings being issued I know I'll have to try again, but quite frankly I'm very nervous to do so.

It's a real shame as I love the program (as does my client) and I would love to recommend this to my other clients, but I just can't do that confidently.

Thanks for the advice, we did try that as well, but like you mentioned, it doesn't help the customers and was not a permanent solution.

Link to comment
Share on other sites

Thanks for your quick & honest response Slaer!
Has this only started to occur in v1.3? There are so many sites out there using Prestashop that it can't be happening for everyone? But I've seen so many reports of this error and no apparent solution for any of them. For such a serious problem you'd think it would be high priority!
Does anyone know if there is a specific cause for this error, or does it happen in various places? I'm new to Prestashop so I'm not familiar with the set up, but it looks to me like its in more than one location - I get it on the Front end when I log out and then try to log back in again, and also in the Back end in the catalog.
I really like Prestashop and had decided to go with it until this started happening. This is killing me!! I can't recommend it to my client like this... back to the drawing board I guess...

Link to comment
Share on other sites

  • 2 months later...

hi,

I'm running 1.3.1.1 and I fixed this issue by following the instructions earlier on this post by putting the token variable in the form on AdminTabs.php
This is the diff:

Index: classes/AdminTab.php
===================================================================
--- classes/AdminTab.php (revision 58)
+++ classes/AdminTab.php (revision 59)
[spam-filter] -955,6 +955,7 [spam-filter]
if (Tools::getIsset($this->table.'Orderby'))
echo '&'.$this->table.'Orderby='.urlencode($this->_orderBy).'&'.$this->table.'Orderway='.urlencode(strtolower($this->_orderWay));
echo '#'.$this->table.'" class="form">
+ <input type="hidden" name="token" value="'.($token ? $token : $this->token).'" />
<input type="hidden" id="submitFilter'.$this->table.'" name="submitFilter'.$this->table.'" value="0">

Link to comment
Share on other sites

  • 9 months later...
  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...