Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Valid CSRF Token Required

I have created a new mod of file archive for my osticket.
In this file archive, the file id, file name and download links are read from mysql table and it is downloadable.
But on the other side, I have a file manager section on staff portal where some staff (based on their role) they are allowed to upload files.

The problem is, when I upload a file, upon load button I am getting "Valid CSRF Token Required" error.
There was a post regarding this problem by "PETER" which he mentioned that its due to expiration of "CSRF TOKEN" and a page refresh/re-login will fix it, but in my case the problem still persists despite of trying the mentioned solutions by "PETER".

anybody who has had the same problem, please share you solutions with me.

Best Regards.
~Bonapart

Comments

  • The answer I posted was specific to login page. In your case, make sure the form you're use to upload files adds CSRF token - see other forms on how to do so.
  • Dunka!!

    The problem was due to the token expiration.
    thanks to you ("PETER"), I just added the "csrf_token()" function inside form and now the problem is solved.

    ...............
  • Can you explain where did you add that code?
    Please specifiy file, folder, and line number.
    Thanks,
  • This thread is from 2013 and for v1.7.  I highly doubt that you are running 1.7 and if you are you need to upgrade as its no longer supported.

    Closing zombie thread.
This discussion has been closed.