"Valid CSRF Token Required" in Osticket After login?

17.5k Views Asked by At

My osTicket Version 1.10 is installed in PLESK Windows Server. I have tried to install XAMPP on the PLESK Windows Server but not able to start XAMPP .

Soon I get error after login to osTicket "Valid CSRF Token Required in Osticket After login" which was earlier working fine

After login I get this error:

enter image description here

8

There are 8 best solutions below

1
On

in include/class.ostsession.php

Just add this line:

$this->data->session_data = "";

After:

catch (DoesNotExist $e) {
        $this->data = new SessionData(['session_id' => $id]);

So it will be:

catch (DoesNotExist $e) {
        $this->data = new SessionData(['session_id' => $id]);
        $this->data->session_data = "";

Then try to login from scratch, don't just refresh the submission.

0
On

I received this error after installing OST 1.10 on Windows Server 2012 with IIS 7 using PHP Manager for IIS. (http://osticket.com/wiki/Installation#Windows_Recommended_Links) Accorinding to "To install osTicket, your web server must have PHP 5.3 (or better)" I installed "the latest PHP version" in my case 7.1.1. With PHP 7.1.1 I could not login into the SCP. After changing the PHP Version from 7.1.1 to 5.4.45 everything works fine.

0
On

Its because of varnish cache login credentials.

Test directly with web server host entries. It will work.

3
On

I had the same problem. MySQL table 'ost_session' was broken. Run this command in MySQL: REPAIR TABLE ost_session

0
On

My configuration

  • Win 2012 R2 Standard (64bit)
  • PHP 7.1.7 64bit (installed by Web Platform Installer)
  • MySql 14.14 Distrib 5.7.20 (installed by MySql Installer Community Edition)
  • osticket 1.10 (on IIS)

I had the same problem: "Valid CSRF Token Required..."

Here is where I found the fix: https://github.com/osTicket/osTicket/commit/424bfc99d93b920f6162b602eeea41125086425d

And here is a conversation about the problem: https://github.com/osTicket/osTicket/issues/3546

0
On

I might be late, but what worked for me was to use another browser on my computer or clearing the cache

1
On

I had the same problem with PHP 7.1.1, then I changed to 7.0.15 and it worked

0
On

Login to you server using ssh(ssh username@ip) and then check if in your Apache/Centos config file following setting is enabled using the below command

For Centos - nano /etc/httpd/conf/httpd.conf
For Apache - nano /etc/apache2/apache2.conf

Then replace

Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure

with

#Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure

At last restart the web server.