CSRF token is wrong - please try to login again

Issue #330 resolved
Former user created an issue

Hello,

After inserting new entry I get the error "CSRF token is wrong - please try to login again".

I am using phpLiteAdmin v1.9.7.1 phpinfo() PHP Version => 5.6.30-0+deb8u1

I am not able to login with another PC too (got CSRF is wrong).

Can someone help me ?

Comments (13)

  1. rdpdo

    hello again,

    I have deleted my cookies and now I cannot login anymore ... I got the message CSRF token is wrong - please try to login again

    Thanks in advance for helping me.

  2. rdpdo

    Hello again,

    I have installed the lastest dev version but now I have the error SQLiteDatabase: not installed... Do you know how to install it on debian ? Thanks !

  3. phpLiteAdmin repo owner

    Is your SQLite database a version 2 database or version3? Current PHP versions do not support SQLite 2 anymore. SQLiteDatabase is for SQlite version 2. It is normal that it is not installed in modern PHP setups, but this also means you cannot use phpLiteAdmin to manage SQLite 2 databases with these PHP versions. If your database is SQLite 3, then there is no need for SQLiteDatabase. You either need SQlite3 php-extension or PDO with SQLite driver installed. Please post the complete error message so I can understand better what's going on.

    With "latest dev version" you mean phpLiteAdmin version 1.9.8-dev?

  4. phpLiteAdmin repo owner

    From your php version I assume you are on Debian Jessie. To be able to manage SQLite 3 databases with phpLiteAdmin you need the php5-sqlite package installed.

    Imho the php version included in Jessie (PHP 5.6) cannot be used to open SQLite 2 databases.

  5. rdpdo

    Hello, thanks you for answering.

    Yes I am using the dev version because there where bug with CRFS.

    My sql is version 3. I have executed apt-get install php5-sqlite and this tell me that I use already the latest version:

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    php5-sqlite is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.
    

    My php version is :

    phpinfo()
    PHP Version => 7.1.8-2+0~20170804100723.7+jessie~1.gbpae7f04
    

    Si I have unninstalled php7 and installed php5:

    phpinfo()
    PHP Version => 5.6.31-4+0~20170804100521.6+jessie~1.gbpea630b
    

    But still have the error :

    There was a problem setting up your database, /usr/src/flexget/. An attempt will be made to find out what's going on so you can fix the problem more easily.
    
    Checking supported SQLite PHP extensions...
    
    PDO: installed
    PDO SQLite Driver: installed
    SQLite3: installed
    SQLiteDatabase: not installed
    
    ...done.
    
    The problem cannot be diagnosed properly. Please file an issue report at https://bitbucket.org/phpliteadmin/public/issues?status=new&status=open.
    See https://bitbucket.org/phpliteadmin/public/wiki/Installation for help.
    

    If you have some idea to help me ?

    Thanks a lot !

  6. phpLiteAdmin repo owner

    Normally, this output indicates that you have everything to manage SQLite 3 DBs with phpLiteAdmin. Please try if you can open your DB with the sqlite3 executable like this:

    • install the sqlite3 package (apt-get install sqlite3)
    • cd into the directory where your db is
    • open the db with sqlite3 with sqlite3 db-filename.sqlite (adjust the filename of course)
    • List the table with .tables - this should give you a list of the tables in the db
    • try to select data, e.g. with SELECT * FROM tablename;
    • run .quit to close sqlite3

    Does this work as expected?

  7. rdpdo

    Hello and thanks you for your help,

    I have done waht you said and all is working perfecly... but I still have error :

    There was a problem setting up your database, /usr/src/flexget/. An attempt will be made to find out what's going on so you can fix the problem more easily.
    
    Checking supported SQLite PHP extensions...
    
    PDO: installed
    PDO SQLite Driver: installed
    SQLite3: installed
    SQLiteDatabase: not installed
    
    ...done.
    
    The problem cannot be diagnosed properly. Please file an issue report at https://bitbucket.org/phpliteadmin/public/issues?status=new&status=open.
    See https://bitbucket.org/phpliteadmin/public/wiki/Installation for help.
    

    So I tried to install lastest stable version phpLiteAdmin_v1-9-7-1 and not use dev version.

    That work one time, i login and I can edit my db. BUT after logout, if I try to login I got the error : CSRF token is wrong - please try to login again

    Any idea ??

    Thanks you very much...

  8. rdpdo

    EDIT: Well If I close my tab and reopen a new from chrome it seems to work ! Cool !

    Problem resolved thanks !

  9. phpLiteAdmin repo owner

    Version 1.9.7.1 has a known issue #312 that if you log out, you cannot directly log in again, you will get a CSRF token mismatch. But if you log out and refresh the page, it works. This issue has been solved in the development version with commit 8f647a7e67c9fc037961c449c1536bb3e6f7a85d

    But the dev version still gives the "problem setting up your database", right? I will have a look if I can find out what changed there since 1.9.7.1 stable.

  10. phpLiteAdmin repo owner

    Wait, the error says that your database that it tries to open is "/usr/src/flexget/" - but this is a directory path. Can you please post

    • your configuration, i.e. $directory, $subdirectories and if $directories is false, then also $databases.
    • the complete path (including filename) of the db you want to open
  11. Log in to comment