goodpeeps Posted August 23, 2010 Share Posted August 23, 2010 Hello,I am getting the invalid security token error. I tried to determine the issue. The problem comes from admincart.php. Under the tab: customer->carts, you get a listing of carts. From there, you can click on a cart and it will display the contents. When I try to click on the product name (which would send me to the product update page), I get the invalid token. I also get the invalid token when selecting the customer's name or anything else on the page. When I looked into it further, I noticed that the token generated for that page is incorrect. It doesn't match the token for the admintab pages.I looked into the code and saw that it uses the given id_tag and employee id (which seem to return ok) and then generates a md5 using the cookie key. I even tried to manually replace the line where the token key is generated in the admincarts.php with direct code using the cookie key and different strings (e.g. AdminCatagories, AdminCarts and AdminCatalog) with the attached keys (i.e. 1 for the tab and 0 for the employee id). every iteration returns the incorrect token key. Would someone help me find the problem?ThanksEDIT2:Fixed it with creating a new cookie. I don't think that its a proper solution to the problem. Someone know why the global $cookie would loose its' value in the admincarts.php and not anywhere else?EDIT:I found the problem. the $cookie->id_employee returns 0 when it should be 1.Where is the $cookie var created? Any ideas?the function in admincarts.php viewDetails has the global $cookie declared but it looks like the cookie is empty.Thanks again Link to comment Share on other sites More sharing options...
rocky Posted August 23, 2010 Share Posted August 23, 2010 The cookies are created in init.php (in the root directory for the Front Office cookie and the admin directory for the Back Office cookie). Link to comment Share on other sites More sharing options...
goodpeeps Posted August 23, 2010 Author Share Posted August 23, 2010 Rocky,Thanks, I found your site with that information. Upon further investigating, I noticed that the AdminCarts.php uses the global $cookie for the construct and it is fine. The problem lies in the viewDetails function. The global $cookie has no value at that point. I created a class variable and stored the cookie there. I them recalled it in the viewDetails function. I don't like this solution. I am curious to know why the $cookie has no value at this point. From what I gather, the index.php calls the display function (haven't check the cookie there). I see that it changes a few keys in that file.Any pointers?Thanks Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted May 7, 2012 Share Posted May 7, 2012 Did you find an easier solution to this issue? Link to comment Share on other sites More sharing options...
Recommended Posts