Token Mismatch Error

everytime one of my users try to login on the first try they get the below error

We encountered an error (token mismatch). This probably means that the page you were using expired. Please try again

but when they try logging in a second time theres no issue. I have also experienced the issue.

please help !!

  • Use login redirector plugin it works like charm.

    @Dhrup Please provide us with the url for the solution so that we can get it correct. Because i did not found it on searching on comunity search so i thought this is only thread where discussion is going on.

    Sorry about that if i have done anything wrong.

    Sam.

  • what url ?

    google "Elgg Token Mismatch Error" ;-)

    LOLZ ;-)

  • RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^example\.com
    RewriteRule (.*) http://example.com/$1 [R=301,L]

     

    this works, I placed it just before </IfModule> in .htaccess

    obviously replace example.com with your own URL

    and it worked for me, be sure in Site administration:

    under

    "The site URL, followed by a trailing slash:"

    have http://yoursite.com and not http://www.yoursite.com

    I did not find a way to making it work for www.mysite.com

    I personally think it looks better if the address is www.mysite.com as this is what users recognise I also note that this website uses http://comunity.elgg.org so perhaps elgg works best this way or its just there preference I don't know.

    According to Cash Costello theres a way to do it the other way

    also suggested looking for more information from this link.

    If anyone here works out how to make it work for www.site.com let me know.

    I hope this helps some here.

  • I found this info, I wonder if the answer is in this

    I tried it but I failed to make it work.

     

    Canonical Hostnames

    Description:
    The goal of this rule is to force the use of a particular hostname, in preference to other hostnames which may be used to reach the same site. For example, if you wish to force the use of www.example.com instead of example.com, you might use a variant of the following recipe.
    Solution:
    # For sites running on a port other than 80
    RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteCond %{SERVER_PORT} !^80$
    RewriteRule ^/(.*) http://fully.qualified.domain.name:%{SERVER_PORT}/$1 [L,R]

    # And for a site running on port 80
    RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R]

  • 14 hours ago

    hi i have problem with token mismatch error while login. i have scanned all previous community answers. but i am not getting a solution. i am explaining my problem her. when i give url format http://www.example.com, i can login to the page. however,while i enter http://example.com, it shows the token mismatch error. what should i do with my htaccess file and where i should write the command on htaccess file. kindly help me.

  • I have the token mismatch error in IE, but not in any other browser. The problem happens when I connect to ANY of the elgg sites I have used.  This has nothing to do with rewrite rules. I am using the same links I've been using.  This is a very serious bug.

  • Hey guys,

    I am facing the same problem. I can't get solution even after trying out Boris' solution.

  • This is what i added to my .htaccess file and it corrected my token mismatch error

    Add this to the begining of .htaccess file

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^myelggsite\.com
    RewriteRule (.*) http://myelggsite.com/$1 [R=301,L]

    i redirected http://www.myelggsite.com to http://myelggsite.com

    If it is not redirecting ask for support from your hosting provider.

     

  • Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^myelggsite\.com
    RewriteRule (.*) http : // myelggsite.com/$1 [R=301,L]