trac : Missing or Invalid form token

trac-dhProblem description

When installing a trac one-click setup package on Dreamhost, you might encounter the error “Missing or invalid form token. Do you have cookies enabled?”. This isn’t an error that is limited to Dreamhost installations, as I have seen it crop up a bit everywhere.

This is an error in the installation of your .htaccess file. The url rewrite rules are not available for the javascript files. That is (fortunately) quite easy to solve.

Solution

When looking in the .htaccess file that controls your trac install (in the trac directory itself normally), you can find some rules like this:

RewriteCond $1 !^(.*).css$
RewriteCond $1 !^(.*).gif$

All you have to do is add the rule for the javascript files to it:

RewriteCond $1 !^(.*).js$

That should take care of the problem.

The solution was mentioned on the trac site.

Enjoy!

Leave a Reply