Thread:Extension talk:GoogleLogin/SpecialGoogleLogin not setting session?

Hey guys,

So I've been looking for an extension that would allow us to do exactly what this extension does, so thanks for creating it. Unfortunately, I've been beating my head against the desk today working on something so I thought I would share here in order to save anyone else the trouble. I would submit this as a bug but I'm not entirely confident in myself that I didn't simply miss something.

That being said, I am running GoogleLogin with $wgGLReplaceMWLogin = true and $wgGLAllowedDomains = array('example.com') in hopes that I could have my employees click the login button and immediately be sent to google. Furthermore, I wanted any example.com address to be instantly validated. The problem I was having was that if I started from a completely fresh browser (either all history and cookies cleared or some sort of incognito mode) I would hit login, be sent to google, login to google, and be redirected back to the login page. It didn't seem to be actually logging me in.

Upon further investigation, I found that the problem lied in that, if I had $wgGLReplaceMWLogin = false, it worked perfectly and, also, when the path sent me back to Main_Page, it was giving me 3 variables: a session id, a user number, and a user name.

If I did the same with $wgGLReplaceMWLogin = true, it was not returning a session id.

Further scrutiny of the SpecialGoogleLogin and SpecialUserLogin pages revealed that the execute function on SpecialUserLogin was setting the session as follows:

if ( session_id == '' ) { wfSetupSession; }

SpecialGoogleLogin was not setting the session at all as far as I could tell.

In order to resolve this issue, I took the above snippet of code and placed it at the very beginning of the execute function on SpecialGoogleLogin page. This seems to have resolved my issue.

If anyone has a chance, could you please check my work? I am a very novice developer, so I am not very confident and am slightly worried that I have overlooked/overcomplicated things.

Thanks guys!