ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MSM Login issue

September 13, 2007 3:53pm

Subscribe [3]
  • #16 / Sep 13, 2007 5:58pm

    Lisa Wess

    20502 posts

    Not necessary a must, I don’t currently have my extra Sites public so only visit via the /system/ directory and never set the actual cookie domain and have no problems.  You’re welcome to post a note and I’ll research if it should become part of the main documentation.  Thank you, Adam!

  • #17 / Sep 26, 2007 10:36am

    Erskine

    46 posts

    Hi folks,

    I’m running three domains using MSM (on EE1.6, everything up to date). The EE install is on domain1.com, and if logged in to admin, one is logged in to that site’s front end of course.

    I have two other domains, say, domain2.com and domain3.com.

    I appear not to be logged in to domain1.com or domain2.com at all. I tried the following in the Cookie Domain field for the three domains (so I added this for each site’s prefs):

    .domain1.com & .domain2.com & .domain3.com

    No Cookie Path or Cookie Prefix are set in any site’s prefs. All different domains (no subdomains here) and all on the smae server. All sites show perfectly and run well from one install, but no shared logins.

    I deleted all stored cookies, logged out, then logged in afresh, but I’m still only logged in to domain1.com.

    Any ideas if I’m doing anything wrong here?

  • #18 / Sep 26, 2007 11:44am

    Robin Sowell

    13255 posts

    No- I don’t think you’re doing it wrong.  You log into the backend in system/index.php- correct?  No separate login for each backend domain via masking?

    Can you switch between sites in the backend ok?  Flipping through as a superadmin?

    ETA- and what’s your security setting for backend access- cookies, sessions or both- for each domain?

  • #19 / Sep 26, 2007 11:51am

    Erskine

    46 posts

    Hi Robin - long time no converse, though I did see a nice comment from you on one of my desperation threads at the weekend..

    Let’s see. Yes, logged in as SA, can switch sites and do any task across the three sites. System folder renamed as “admin” as usual. No masking of any kind.

    Security: When I wrote the message above, it was default - cookies for front, cookies and sessions for admin. Now changed it to cookies for front and admin. No change.

    All the EE admin files are at domain1.com. Then domain2.com and domain3.com have the path.php and index.php files at their root. No other MSM-related directories, forwarding or crazy stuff. Jamie actually set it up on our new server so I’ll point him at this thread too.

    I am right to be specifying my cookies as I mentioned above, right? All three in the Cookie Domain Field.

    This build has been hell from start to finish, but a few more leaps and it’ll be done.

  • #20 / Sep 26, 2007 1:00pm

    Robin Sowell

    13255 posts

    Bugger- yes, I was avoiding coming back to this because it makes my head hurt.  I THINK it’s acting normally- and that to log into the frontend of each of the MSM sites (aside from the ‘main’ one which is under the domain where you logged into the CP) you’ll need to login on the frontside.

    It MIGHT work with no cookie domains set at all- so you could try that one.  But I won’t swear on it.  I know there was a multi-site login that would set cookies for each listed site when you login from the frontend- so if you have users that login to domain1- they would also have cookies set for domain2 and domain3.  The only MSM site I’m running live, we don’t actually want that behavior, so I have avoided thinking about it until now.

    Which is all a rather long way of saying- I’m actually going to ask the crew about this one.  The backend is working normally, just like I’d expect.  Let me see if I can get some more detail for you.

    But- to double check- you can login to the frontend of each MSM site no problem- it’s just an individual thing?

  • #21 / Sep 26, 2007 1:21pm

    Erskine

    46 posts

    Hmm. Users are only able to login/interact with domain1.com at present, so I set up a login form hidden on domain2.com, then logged out of admin, and then tried to login through domain2.com’s test login form. Note that the form’s post value was domain2.com.

    The User Message template showed and said I was logged in, but then went to a page on domain2.com that has an {if logged_in}You are logged in{/if} test message, which didn’t show.

    Importantly, no cookies showed up for domain2.com. Therefore, it seems I cannot login through the front end of the other two domains, only domain1.com.

    I should mention that this evil complex site has membership running through Amember on domain1.com, but all membership records in EE are up to date and fine, so I don’t think it matters. The worry is that the client will ask for user interactivity on the other domains at some point, I’m sure of that.

    Oh, and your other point - back before I changed any cookie prefs, all Cookie Pref fields were blank anyway, and it wasn’t working, which is why I tried setting cookie domains etc.

    Appreciate you looking into this for me Robin. I can always count on you to try. Sorry I always ask tough questions!

  • #22 / Sep 26, 2007 1:28pm

    Erskine

    46 posts

    OK, I changed domain2.com’s cookie value to just .domain2.com and the login process mentioned above now works. I see the {if logged_in} message.

    So, users can login through the secondary domains, but sadly they will not also be logged in to domain1.com or domain3.com, which I really need to happen.

    Just so you are clear, cookie pref settings as follows so far:

    Domain1 prefs; .domain1.com & .domain2.com
    Domain2 prefs: .domain2.com

    Maybe umpteen tweaks in these prefs might solve it? I’m a bit lost.

    Ideally, an administrator ought to be able to log in to admin, and be automatically logged in to every front end, but I am aware of the “dark arts” at play here.

  • #23 / Sep 26, 2007 1:58pm

    Robin Sowell

    13255 posts

    Aha- ok, was searching and looks like multi-site login code is still in there, even with MSM.  FTP in and grab config.php and open it up.  Add:

    $conf['multi_login_sites'] = "http://www.siteone.com/|http://www.sitetwo.com";

    This wiki entry suggests leaving the cookie domains blank if you try it.  But I’d leave them in there for the moment.

    This will only work for the frontend logins- but should get them logged into all sites when they log into 1 MSM site.  But- I’ve never done it with MSM, so we’re experimenting a bit.  x-fingers!

  • #24 / Sep 26, 2007 2:20pm

    Erskine

    46 posts

    Tried that line in config.php, and firstly with cookie prefs as listed in previous message, and then without. Either way it only logs me in to domain2.com if I log in from that site.

    Note that I emptied cookies before my last attempt and then had a look at what crumbs it has deposited. Not sure if this is useful, but…

    For both sites, logging in via domain2.com has set the exp_last_activity, exp_last_visit and exp_tracker cookies.
    Only domain2.com has exp_uniqueid, exp_userhash, exp_sessionid cookies.

    I assume that would be the other way around if I logged in from domain1.com. So confusing.

  • #25 / Sep 26, 2007 2:24pm

    Derek Jones

    7561 posts

    Simon, make sure that the URLs you are including in that config variable are the full URLs to your index.php files.  The login action portion of the URL will be appended directly, so if you are not including index.php, the domain will at least require a trailing slash, as http://www.example.com?ACT=... will not work.

  • #26 / Sep 26, 2007 5:03pm

    Erskine

    46 posts

    Derek, Robin,

    This kind of works, so big thanks for the pointers.

    In config.php I have:

    $conf['multi_login_sites'] = "http://www.domain1.com/index.php|http://www.domain2.com/index.php";

    So, no trailing slash (that didn’t work) but as you say, index.php makes it work - kind of.

    Firstly, if I login via domain2.com it won’t log me in to domain1.com, but that is OK for now.

    Secondly, for my client to see “Edit” links on articles on both sites, he must first login to admin in the usual way, and then go to a second login form hidden on domain2.com. By logging in there, he is then logged in everywhere.

    A bit clunky, and I don’t have total confidence in it, but vital for my client to edit some of the 25,000 articles on the sites.

    This is our biggest EE job to date: MSM, Amember, OpenAds running three sites containing 16 years of archives for Europe’s No.1 art magazine and art fair run by 40 people. Might as well show you the links seeing as we are in soft-launch (not validated etc yet):

    www.frieze.com/magazine/
    www.friezeartfair.com
    www.friezefoundation.org

    There’s a lifetime of case studies, tutorials and warnings in this little lot. Seven months of solid hard work, and a true advertisement for the power of EE I reckon.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases