can't login in Drupal 5.1 with safari which other machine host. but still working in localhost Drupal.

Comments

dsp1’s picture

Category: bug » support
Priority: Critical » Normal

I have drupal 5.1 and no problem with safari.
I don't think it is a bug.

what exactly is your setup? what version of safari? more details so someone can help.

nickchow’s picture

My safari version is 2.0.4
e.g. I have a localhost drupal(my ip is 192.168.1.180) , login in URL like http://localhost/drupal work fine, but can't login in when the URL changed to Http://192.168.1.180/drupal, the same URL in Firefox also work. and access another drupal5.1 host(URL: http://192.168.1.181/drupal) in safari has the same problem.

brianV’s picture

Category: support » bug

Pardon, but I am moving this back to bug reports. I have had a few users on my sites contacting me with login issues in 5.1. The only theme I could find between them is that they were all using Safari. Nobody has reported troubles with other browsers.

On the other hand, there are users with Safari who are having no trouble - is it perhaps specific releases of Safari that are having trouble?

Also see http://drupal.org/node/109775, http://drupal.org/node/120900

mr700’s picture

Try commenting out the following code from your settings.php (sites/default/settings.php):

if (isset($_SERVER['HTTP_HOST'])) {
  $domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);
  // Per RFC 2109, cookie domains must contain at least one dot other than the
  // first. For hosts such as 'localhost', we don't set a cookie domain.
  if (count(explode('.', $domain)) > 2) {
    ini_set('session.cookie_domain', $domain);
  }
}

This code for http://192.168.1.181/drupal will set session.cookie_domain to '.192.168.1.181', which my konqueror dose not like too (and clear cookies). Does this help?

harry slaughter’s picture

It's not just safari this causes problems with.

I just wasted a lot of time finding this new bit of code that prevents me from logging in entirely from any browser on my test server.

In my case, I suspect it has something to do with the fact that my server is running on an alt port(http://foo.bar.com:8080). Code that relies on the host string never seems to take into account the possibility of an alt port.

mr700’s picture

3-4 days ago I saw a bug report regarding the port number, just can't find it now...

Explicitly defining new cookie and host name for each Drupal instance is the current workaround that works for me.

brianV’s picture

Status: Active » Closed (fixed)

Support requrest for a long obsolete version of Drupal.