Jump to content

PS 8 migration to server causes issue with BO CsrfTokenManager->getToken()


tivicrdotcom

Recommended Posts

Good day fellow geeks, so I migrated the site, all good, FO works but BO doesn't. I am getting the following error:

CsrfTokenManager->getToken() in /home/fm1kjtxyz0tz/public_html/src/PrestaShopBundle/Service/Routing/Router.php (line 64)

    public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH)

    {

        $username = $this->userProvider->getUsername();

        // Do not generate token each time we want to generate a route for a user

        if (!isset($this->tokens[$username])) {

            $this->tokens[$username] = $this->tokenManager->getToken($username)->getValue();

        }

        $url = parent::generate($name, $parameters, $referenceType);

        if (TokenInUrls::isDisabled()) {



I manually cleared cache and added a new .htaccess file through ftp as I don;t have access. The only positive thing is that all 5 PS stores present the same problem, so, if I fix one, I fix them all. Thanks in advance!

regards,

AJ

Link to comment
Share on other sites

Hi @ComGrafPL, thanks for replying. So, after lots of research I found and solved the issue on the old server (VPN), it was as suggested, simply to change the destination folder for php from /opt/alt/php81/var/lib/php/session to /tmp. VPN has a clear cache button which I then clicked and worked like a charm.

Now, the new server, which is shared, doesn't have the clear cache button (I have to ask GoDaddy about it), so, I pretty much did the same change, but on this server, that solution doesn't fix the problem as it did on the VPN. I guess I'll have to wait for support to help me with that as I am pretty sure it will solve the issue.

I was getting the same exact error on the VPS, shared hosting is a bit different in terms of cache.

Link to comment
Share on other sites

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