Proposed Solution: Double Login Issues

friesengeist
Joomla! Guru
Joomla! Guru
Posts: 842
Joined: Sat Sep 10, 2005 10:31 pm

Proposed Solution: Double Login Issues

Post by friesengeist » Sat Oct 21, 2006 10:08 pm

Hi everyone,

there are quite a few users who are experiencing problems upon their first frontend login, however, the login works the second time for most of them. The corresponding threads are at least these:
http://forum.joomla.org/index.php/topic,76935.0.html
http://forum.joomla.org/index.php/topic,92425.0.html
http://forum.joomla.org/index.php/topic,67290.0.html
http://forum.joomla.org/index.php/topic,87929.0.html
http://forum.joomla.org/index.php/topic,72398.0.html
http://forum.joomla.org/index.php/topic,71369.0.html

I believe that most of these issues occur for users visiting your page from a URL other than the livesite URL set in your global config. Lets imagine your livesite URL is http://www.example.com, but a user visits you under example.com. Indeed, there is no possibility for this user to login on the first attempt. Now, if you encounter such problems, you might be lucky, as some (if not all) these issues have been identified.

If you are willing to test this proposed solution, please follow these steps. But before you start, keep in mind that all such changes could as well break your site, so I wouldn't use it on a production system, but rather only on a test system.
  • Use the attached files only on Joomla! 1.0.11. They are not compatible with other versions!
  • Make a backup of the files /includes/joomla.php and /modules/mod_login.php first.
  • Download the zip-file which is attached to this post, und unzip it to a temporary location.
  • Overwrite /includes/joomla.php with joomla.php.
  • Overwrite /modules/mod_login.php with mod_login.php.
  • If you have set a value for the "Login Redirection URL" for the login module, please delete it or make sure the domain matches the domain you use as your live_site in global configuration.
  • Please report back if you are still experiencing any login issues.
As said, I would never use any patches directly on a production server, so use them only on a testing server or know what you are doing :)

Looking forward to your feedback,
Enno
You do not have the required permissions to view the files attached to this post.
Last edited by friesengeist on Sat Oct 21, 2006 10:10 pm, edited 1 time in total.
We may not be able to control the wind, but we can always adjust our sails

retromodcoza
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Oct 10, 2006 8:57 pm

Re: Proposed Solution: Double Login Issues

Post by retromodcoza » Sat Oct 21, 2006 10:46 pm

This works Lekker!

Nice - IE and FireFox both login , both on http:// and http://www and first time too.

Installed brand new site , and there was this login problem , then put patch , and perfect!

I then put it on my live site , and it worked perfectly.

Now I have a suggestion : Go get a few beers and celebrate. I now have 12 sites that have login capability!

Seriously....Paypal Address? Send me email.....

cyberbo
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Aug 18, 2005 8:54 am
Location: Denmark - Kolding

Re: Proposed Solution: Double Login Issues

Post by cyberbo » Mon Oct 23, 2006 9:49 am

Hi,

I have also try and it works fine for me to....

Thanks...

/cyberbo

raschidt
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 233
Joined: Mon Aug 22, 2005 7:01 pm
Contact:

Re: Proposed Solution: Double Login Issues

Post by raschidt » Mon Oct 23, 2006 3:58 pm

thanks.

All it´s fine! :D

technopuzzle
Joomla! Ace
Joomla! Ace
Posts: 1958
Joined: Thu Aug 18, 2005 5:53 pm
Location: Washington D.C. & Baltimore, MD Metro
Contact:

Re: Proposed Solution: Double Login Issues

Post by technopuzzle » Mon Oct 23, 2006 7:35 pm

What about adding the following to the configuration.php file? I've found that this fixes the whole issue of sites being accessed from http://www.domain.com or domain.com.

Code: Select all

$mosConfig_live_site = 'http://' . $_SERVER['HTTP_HOST'];
Thanks,
Roger Raymond
Techno Puzzle

lysetskilde
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Thu Apr 27, 2006 7:24 pm
Contact:

Re: Proposed Solution: Double Login Issues

Post by lysetskilde » Tue Oct 24, 2006 8:31 am

THank you  :P
unixboymd

Just what I needed

I began to sweat :o  because I got this problem with log in and my users start writingand I did what you told to do with the configuration.php file,

Thank You once again.

Torben
hilsen
Torben Munk Nielsen
http://www.lysetskilde.com

JerkyPenguin
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Oct 08, 2006 10:37 pm

Re: Proposed Solution: Double Login Issues

Post by JerkyPenguin » Tue Oct 24, 2006 8:38 pm

Fan &*$%ing -tastic!!!

Great job!  Thanks so much!  Go Joomla! :laugh:

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Proposed Solution: Double Login Issues

Post by mcsmom » Tue Oct 24, 2006 8:56 pm

I don't know why this isn't considered the standard fix for so many of these problems.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

technopuzzle
Joomla! Ace
Joomla! Ace
Posts: 1958
Joined: Thu Aug 18, 2005 5:53 pm
Location: Washington D.C. & Baltimore, MD Metro
Contact:

Re: Proposed Solution: Double Login Issues

Post by technopuzzle » Tue Oct 24, 2006 9:23 pm

Me either. I found it in the forums someplace.
Thanks,
Roger Raymond
Techno Puzzle

shumisha
Joomla! Guru
Joomla! Guru
Posts: 512
Joined: Sat Aug 20, 2005 3:15 pm
Contact:

Re: Proposed Solution: Double Login Issues

Post by shumisha » Tue Oct 24, 2006 10:04 pm

Hello all,

I never had this problem, but I am doing something that will also fix this, by adding the following to my .htaccess :

Code: Select all

RewriteCond %{HTTP_HOST} ^mydomain\.com [NC]
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L,NC]
every request form mydomain.com/xxxx is redirected to http://www.mydomain.com/xxxx, through a permanent redirection (you can do it the other way around if you like of course, from www to non-www).

The big advantage (that was the reason to do it in the first place) is to avoid duplicate-content penalties in search engines, as your site is going to be indexed twice. if you do not do something like that mydomain.com/mypage.html and http://www.mydomain.com/mypage.html will have same content on the same domain, but differing sub-domain and URL.
See all about sh404sef and wbAMP at https://weeblr.com
I don't reply to PM anymore. Thanks for using sh404SEF and wbAMP

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Proposed Solution: Double Login Issues

Post by mcsmom » Wed Oct 25, 2006 12:42 pm

;)
http://forum.joomla.org/index.php/topic ... #msg464303

Someone showed it to me back on Mambo.
Last edited by mcsmom on Wed Oct 25, 2006 12:46 pm, edited 1 time in total.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

User avatar
TheWagner
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Fri Jul 07, 2006 7:48 pm
Location: Charlottesville, VA

Re: Proposed Solution: Double Login Issues

Post by TheWagner » Wed Oct 25, 2006 1:48 pm

So the .htaccess the safest method? I've placed the code into my .htaccess file, but its not working. Does something need to be removed, or do these lines need to be in a specific place?  Sorry for the confusion. I'm new to this.

User avatar
davemacd
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Mar 07, 2006 9:47 am

Re: Proposed Solution: Double Login Issues

Post by davemacd » Wed Oct 25, 2006 2:11 pm

Still getting the same issue after applying this patch on my Joomla site running under IIS (so I can't use .htaccess method).

The only fix I can find that works is either ticking the remember me box or checking the login message parameter on the login module which says "You are now logged in". These work - but aren't great solutions !

Have tried removing my login redirection, tried the attached files, tried the other '0' session fix - but still not working as it was before  :(

friesengeist
Joomla! Guru
Joomla! Guru
Posts: 842
Joined: Sat Sep 10, 2005 10:31 pm

Re: Proposed Solution: Double Login Issues

Post by friesengeist » Wed Oct 25, 2006 8:33 pm

unixboymd wrote: What about adding the following to the configuration.php file? I've found that this fixes the whole issue of sites being accessed from http://www.domain.com or domain.com.

Code: Select all

$mosConfig_live_site = 'http://' . $_SERVER['HTTP_HOST'];
Joomla! 1.5 is doing something quite similiar - no mosConfig_live_site anymore. I doubt it though that this will change for 1.0.x - it changes behavior, and is probably out of scope of a stability release. I can also see one problem arise from this change: let's imagine your users log in on http://www.example.com. Now lets assume you have a hardcoded Link in your content to example.com/index.php?whatever. The user logged in on http://www.example.com, and will be treated as a guest on example.com - this would just create one new instance where a user might think he got logged out. That's why I'm not in favour of adjusting the livesite dynamically in 1.0.x. I'd rather get the login issues fixed, and leave the livesite settings alone (except for the https switchover which will probably make it into 1.0.12).
We may not be able to control the wind, but we can always adjust our sails

User avatar
davemacd
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Mar 07, 2006 9:47 am

Re: Proposed Solution: Double Login Issues

Post by davemacd » Wed Oct 25, 2006 8:38 pm

Tried that too - didn't fix my problem when running under IIS I'm afraid  :(

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Proposed Solution: Double Login Issues

Post by mcsmom » Wed Oct 25, 2006 8:41 pm

Maybe I am just very consistent in my hard coded links, but I haven't noticed this problem.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

friesengeist
Joomla! Guru
Joomla! Guru
Posts: 842
Joined: Sat Sep 10, 2005 10:31 pm

Re: Proposed Solution: Double Login Issues

Post by friesengeist » Wed Oct 25, 2006 8:47 pm

davemacd wrote: The only fix I can find that works is either ticking the remember me box or checking the login message parameter on the login module which says "You are now logged in". These work - but aren't great solutions !
Interesting find, the thing about the login message.

I don't have access to IIS, and found out that it's not within the MSDN Academic Alliance, from where I thought I could get it.
I'll take a look at it this weekend and ask some of the other devs to test this on IIS. I've seen some interesting posts about redirection, cookies and IIS somewhere, just need to digg it up ;)
We may not be able to control the wind, but we can always adjust our sails

User avatar
davemacd
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Mar 07, 2006 9:47 am

Re: Proposed Solution: Double Login Issues

Post by davemacd » Wed Oct 25, 2006 8:50 pm

Thanks, much appreciated.

For now I am using the login message and it's working round the problem so no massive hurry  ;)

friesengeist
Joomla! Guru
Joomla! Guru
Posts: 842
Joined: Sat Sep 10, 2005 10:31 pm

Re: Proposed Solution: Double Login Issues

Post by friesengeist » Wed Oct 25, 2006 8:51 pm

mcsmom wrote: Maybe I am just very consistent in my hard coded links, ...
That's a good thing. I never write the domain name into the links, but have the SEF-URL-Mambot run on it, so that it will use the live_site when converting the link to the SEF-version.
mcsmom wrote: ... but I haven't noticed this problem.
Try this to simulate the bahviour I'm describing:
Clear all cookies, log in on http://www.yourdomain.com, and go to yourdomain.com afterwards. You should find out that Joomla! treats you as a guest...
We may not be able to control the wind, but we can always adjust our sails

User avatar
Beat
Joomla! Guru
Joomla! Guru
Posts: 840
Joined: Thu Aug 18, 2005 8:53 am
Location: Switzerland
Contact:

Re: Proposed Solution: Double Login Issues

Post by Beat » Wed Oct 25, 2006 9:04 pm

friesengeist wrote:
unixboymd wrote: What about adding the following to the configuration.php file? I've found that this fixes the whole issue of sites being accessed from http://www.domain.com or domain.com.

Code: Select all

$mosConfig_live_site = 'http://' . $_SERVER['HTTP_HOST'];
Joomla! 1.5 is doing something quite similiar - no mosConfig_live_site anymore. I doubt it though that this will change for 1.0.x - it changes behavior, and is probably out of scope of a stability release. I can also see one problem arise from this change: let's imagine your users log in on http://www.example.com. Now lets assume you have a hardcoded Link in your content to example.com/index.php?whatever. The user logged in on http://www.example.com, and will be treated as a guest on example.com - this would just create one new instance where a user might think he got logged out. That's why I'm not in favour of adjusting the livesite dynamically in 1.0.x. I'd rather get the login issues fixed, and leave the livesite settings alone (except for the https switchover which will probably make it into 1.0.12).
livesite setting needs to stay in 1.0.12, agreeing.

i would rather have joomla redirecting to the correct site automatically in case of an alias site than removing the livesite.
friesengeist wrote: Try this to simulate the bahviour I'm describing:
Clear all cookies, log in on http://www.yourdomain.com, and go to yourdomain.com afterwards. You should find out that Joomla! treats you as a guest...
That's absolutely normal: for cookies, these are two different sites, and browsers don't allow cookies to spread.

Thus, the only cure is redirecting in case of wrong site, either in the dot htacceess file or in joomla itself ;)
Beat 8)
www.joomlapolis.com <= Community Builder + CBSubs Joomla membership payment system - team
hosting.joomlapolis.com <= Joomla! Hosting, by the CB Team

User avatar
MrRoyce
Joomla! Ace
Joomla! Ace
Posts: 1176
Joined: Mon Oct 09, 2006 9:52 pm
Location: Tampuh Floriduh - The jewels of America's wang.
Contact:

Re: Proposed Solution: Double Login Issues

Post by MrRoyce » Thu Oct 26, 2006 1:44 pm

Ok..go slow for a newbie. 

From what I can gather from this thread, there are 3 proposed solutions to the issue. 

- Overwriting the files as in the original post by friesengeist
- changing .htaccess as suggested by shumisha
- changing the configuration.php as suggested by unixboymd.

Is there any kind of consensus?  ???

I've been using Joomla for all of about a month or so and reading some of these threads can get kind of confusing!  :-[

User avatar
TheWagner
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Fri Jul 07, 2006 7:48 pm
Location: Charlottesville, VA

Re: Proposed Solution: Double Login Issues

Post by TheWagner » Thu Oct 26, 2006 1:50 pm

Agreed. I'm still  lost on the best solution and I can't get the dot htaccess change to solve the problem.
I added the code, and when I go to domain.com it does not automatically take me to http://www.mydomain.com.

ks_tiwari
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Sun Oct 22, 2006 2:34 pm

Re: Proposed Solution: Double Login Issues

Post by ks_tiwari » Thu Oct 26, 2006 3:35 pm

Me too....so which one is the best solution it ... ???
Last edited by ks_tiwari on Thu Oct 26, 2006 3:52 pm, edited 1 time in total.

User avatar
boppinbob
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Sun Nov 27, 2005 5:19 am
Location: Houston
Contact:

Re: Proposed Solution: Double Login Issues

Post by boppinbob » Thu Oct 26, 2006 6:07 pm

Enno's solution works for me. Just need to back up before patching production site.
Live free or die
http://www.geekoffice.com

friesengeist
Joomla! Guru
Joomla! Guru
Posts: 842
Joined: Sat Sep 10, 2005 10:31 pm

Re: Proposed Solution: Double Login Issues

Post by friesengeist » Thu Oct 26, 2006 6:16 pm

MrRoyce wrote: Ok..go slow for a newbie. 

From what I can gather from this thread, there are 3 proposed solutions to the issue. 

- Overwriting the files as in the original post by friesengeist
- changing .htaccess as suggested by shumisha
- changing the configuration.php as suggested by unixboymd.

Is there any kind of consensus?  ???

I've been using Joomla for all of about a month or so and reading some of these threads can get kind of confusing!  :-[
All three are valid, let me try to explain the differences:
  • The initial post of this thread is meant for getting feedback from users, if it solves all know login issues. So far, I'm satisfied with the results, only Microsoft's Internet Information Server (IIS) still has problems. So something quite similiar to this will probably be used in 1.0.12, I'll discuss some details with Beat in the next days.
  • Changing .htaccess will not work on every server, as a special module (mod_rewrite) needs to be loaded by the server. I have no clue how this would look like in IIS, but I doubt it that you can use a .htaccess (written for Apache) on IIS. So this is indeed a good solution, but not really within the scope of Joomla!, as it depends to much on your server config. However, this avoids penalties for duplicate content from search engines, as your content can only be found under one doamin - so it's basically a good thing.
  • Changing the configuration.php (or achieving the same thing in any other file) is IMHO out of scope for 1.0.12, as stated earlier by me.
So it's your choice, use what ever solves the issues for you :)

BTW, thanks to everyone who tested the patch! Let me hear if there is anyone for whom this is not working (except for IIS).
Last edited by friesengeist on Thu Oct 26, 2006 6:18 pm, edited 1 time in total.
We may not be able to control the wind, but we can always adjust our sails

jave
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Oct 26, 2006 10:09 pm

Re: Proposed Solution: Double Login Issues

Post by jave » Thu Oct 26, 2006 10:36 pm

i have jommla 1.0.8 and the patch will ot work.
can you give me a help with this version?

technopuzzle
Joomla! Ace
Joomla! Ace
Posts: 1958
Joined: Thu Aug 18, 2005 5:53 pm
Location: Washington D.C. & Baltimore, MD Metro
Contact:

Re: Proposed Solution: Double Login Issues

Post by technopuzzle » Thu Oct 26, 2006 11:00 pm

Upgrading to the latest and greatest release of Joomla not only fixes bugs but also helps keep your site secure.
jave wrote: i have jommla 1.0.8 and the patch will ot work.
can you give me a help with this version?
Thanks,
Roger Raymond
Techno Puzzle

User avatar
RobS
Joomla! Ace
Joomla! Ace
Posts: 1367
Joined: Mon Dec 05, 2005 10:17 am
Location: New Orleans, LA, USA
Contact:

Re: Proposed Solution: Double Login Issues

Post by RobS » Fri Oct 27, 2006 6:12 am

To reinforce Enno's last post. 

This topic of this thread is on feedback for the proposed solution.  Let's stay on this topic please.

Thanks.
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Proposed Solution: Double Login Issues

Post by mcsmom » Fri Oct 27, 2006 7:10 pm

ry this to simulate the bahviour I'm describing:
Clear all cookies, log in on http://www.yourdomain.com, and go to yourdomain.com afterwards. You should find out that Joomla! treats you as a guest...
That's a different issue, but it is okay if you log in as one or the other since the above solution solves the javascript problems that come from www v. non www.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

BrianDW
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri Oct 27, 2006 8:06 pm

Re: Proposed Solution: Double Login Issues

Post by BrianDW » Fri Oct 27, 2006 8:56 pm

ok,i installed 1.0.11,registered my self as a regular member( i have a seperate login for admin).would try to log in and it shows as having one guest online,go to admin,shows my user as registered and such but not logged in.i tried the 2 file overwrites and still the same problem.and yes the log in is from the same IP as backend.tried from another PC in the house with same results. this might be why i couldnt get Community Builder to work for me as well.any help is appreciated.
Brian


Locked

Return to “Superseded Issues - Archive”