[SOLUTION J1.0.12-] www issue: login doesn't keep

11 years 11 months ago #51352 by sultanos
I have done all the workarrounds , the .htaccess gives me a 500 error even if i only put the [code:1]RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.site.com$

RewriteRule ^(.*)$ site.com/$1
[/code:1]

The

have a workaround in place/



In mod_cblogin.php I have replaced:



$loginPost = sefRelToAbs("index.php?option=com_comprofiler&task=login");



with

$loginPost = (" site.com/index.php?option=com_comprofiler&task=login ");



As it goes through the login process it will still route the user to www.site.com .


didn´t work either.
My web is at vendirsa.weworkwell.com and after introducing valid users it goes back to the beginning as if nothing happens. I have spent 4 hours trying to find a fix for this i really need help
11 years 11 months ago #52701 by joshua.lyon
I have the same issue, but even more interesting. I'm running PHP on IIS6 (Windows Server 2003) using FastCGI. My webserver is at LOCIS1.domain.net, but in IIS I am allowing access to the application pool from LOCIS1, community, community.domain.net, and community.domain.com.

My joomla (1.0.13) site setting is community.domain.net and as such only logins from community.domain.net work. This seems like a big issue to me - even just with people that have the www. issue.

Is this in someones sight as an issue or are some of us on a different page?

---
I should also note that because I'm not running Apache2 (eg. IIS6), mod_rewrite and .htaccess files cannot be used natively.

Post edited by: joshua.lyon, at: 2007/12/19 00:48

---
Josh
11 years 11 months ago #52702 by joshua.lyon
The real issue stems from the CB Login redirecting you to the page you logged in from. So lets say my Joomla site setting is:
[code:1] www.domain.com [/code:1]

But someone sends me a link to the below URL - note the lack of the www subdomain:
[code:1] domain.com/index.php?component=option,com_frontpage&Itemid=1 [/code:1]

I then login at the url that was provided to me (without the www), the cookie is set at the Joomla site setting (with the www), and I am redirected to the page I logged in from (without the www).

However, if I now click on any of the links on my site Joomla will automatically prefix them with the correct site setting (with the www) and I'll go to a page that my login cookie is set at and I will show logged in.

So if instead of simply pulling the full URL that we logged in from and redirecting to that same URL, if we could just pull the PATH that we logged in from and redirect to the JOOMLA-SITE-SETTING concatenated with the PATH then everything would work right.

Eg. Redirection would keep you at the same "page" on the site AND it would put you at the proper domain at which the cookie was set.

Post edited by: joshua.lyon, at: 2007/12/19 01:06

---
Josh
11 years 11 months ago #52705 by joshua.lyon
Here's a quick fix that worked for me and should work for other people with an issue similar to mine. I'm not certain when the PHP function was introduced, but I'm certain it was after 5.1:

Replace:
[code:1]// redirect to site url (so cookies are recognized correctly after login):
if (strncasecmp($mosConfig_live_site, "http://www.", 11)==0 && strncasecmp($mosConfig_live_site, "http://", 7)==0
&& strncasecmp( substr($mosConfig_live_site, 11), substr($login, 7), $len_live_site - 11 ) == 0 ) {
$login = "http://www." . substr($login, 7);
} elseif (strncasecmp($mosConfig_live_site, "https://www.", 12)==0 && strncasecmp($mosConfig_live_site, "https://", 8)==0
&& strncasecmp( substr($mosConfig_live_site, 12), substr($login, 8), $len_live_site - 12 ) == 0 ) {
$login = "https://www." . substr($login, 8);
} elseif (strncasecmp($mosConfig_live_site, "http://", 7)==0 && strncasecmp($mosConfig_live_site, "http://www.", 11)==0
&& strncasecmp( substr($mosConfig_live_site, 7), substr($login, 11), $len_live_site - 7 ) == 0 ) {
$login = "http://" . substr($login, 11);
} elseif (strncasecmp($mosConfig_live_site, "https://", 8)==0 && strncasecmp($mosConfig_live_site, "https://www.", 12)==0
&& strncasecmp( substr($mosConfig_live_site, 8), substr($login, 12), $len_live_site - 8 ) == 0 ) {
$login = "https://" . substr($login, 12);
}
[/code:1]

With:
[code:1] /* JL Hacks to fix subdomain and DNS entry issues*/
$url_parsed = parse_url($login); // This is code to output the login URL that has been parsed into its individual parts
if ($url_parsed != ''){
$login = "index.php?" . $url_parsed;
}
else{
$login = "index.php";
}[/code:1]

Post edited by: joshua.lyon, at: 2007/12/19 03:38

Post edited by: joshua.lyon, at: 2007/12/19 03:40

---
Josh
11 years 10 months ago #53393 by yyviv
Wow cool, thanks Dmcgavock! Finally I fixed the problem:laugh:
11 years 10 months ago #54588 by tborja
dmcgavock wrote:

I have a workaround in place/

In mod_cblogin.php I have replaced:

$loginPost = sefRelToAbs("index.php?option=com_comprofiler&task=login");

with
$loginPost = (" site.com/index.php?option=com_comprofiler&task=login ");

As it goes through the login process it will still route the user to www.site.com .

I don't know how this could be turned into a permanent fix.


I did this change but it did not work. I am using Joomla 1.0.13 CB 1.1. I had to change the live site setting in configuration.php from

mydomain.com to www.mydomain.com to make it work.
Moderators: beatnantkrileon
Time to create page: 0.437 seconds
Facebook Twitter Google LinkedIn