Hi,

I am running a site on one domain .com and using drupal feature (i18n) also to run it on domain .es (http://www.allinternettv.com / http://www.allinternettv.es). It is pure translation and it uses the same database and the same tables.

I have only one settings.php. I use text capcha.

The problem is that on the ES domain, I get "Invalid CAPTCHA token." after I enter corectly captcha.

The COM site is working without porblems.

////

By the way, when I was using Image Captcha, it was not possible to show the image on the ES site.

Thanks

Comments

filip.jurcicek’s picture

Sorry, if forged to write my question. ;-) Don't you know where might be problem? Thank you a lot for your reply. Filip

soxofaan’s picture

It all has to do with session management,
the CAPTCHA module stores the CAPTCHA solution and other data in the user's session (server side).
If you get "invalid CAPTCHA token" errors and no CAPTCHA images, the sessions don't work as expected.

Any ideas why sessions work on your COM domain but not on your ES domain?

filip.jurcicek’s picture

In settings.php, I found this section

/**
* Drupal automatically generates a unique session cookie name for each site
* based on on its full domain name. If you have multiple domains pointing at
* the same Drupal site, you can either redirect them all to a single domain
* (see comment in .htaccess), or uncomment the line below and specify their
* shared base domain. Doing so assures that users remain logged in as they
* cross between your various domains.
*/
$cookie_domain = 'allinternettv.com';

and I set it as you can see. But it does not work also. So, now I do not know what to do else. Hmmm.

filip.jurcicek’s picture

Wow, I just commented out the line: $cookie_domain = 'allinternettv.com';

And the captcha started to work. So this was the problem. But the question is wether it is a bug? I do not have any idea.

soxofaan’s picture

if you had $cookie_domain = 'allinternettv.com' on the settings file of your ES domain site, it is expected that cookies and sessions don't work.
what happens if you put $cookie_domain = 'allinternettv.es' in the settings file of you ES domain site?

or are both sites sharing the same settings file?

filip.jurcicek’s picture

both sites are sharing the same setting.php file

soxofaan’s picture

Status: Active » Fixed

then you should comment out that line with $cookie_domain=foobar

or use a separate settings file per domain (and use the appropriate $cookie_domain value in each one)

filip.jurcicek’s picture

The idea was that I would not have to login into each domain separately. The fact is that both sites share the same user table.

OK. Nothing to do. Thanks a lot for your time. Anyway all Drupal and captcha are amazingly good ;-)

Thanks again, Filip

soxofaan’s picture

Title: Invalid CAPTCHA token. » CAPTCHA, subdomains and cookie domains
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.