1

I am using Membrr and have the following process in place:

  1. Users sign up using Safecracker Registration
  2. Users click on the activation link in their email
  3. Users are automatically logged in and redirected to a "choose your membership plan" Safecracker page (using the add-on: http://devot-ee.com/add-ons/member-activation-redirect)
  4. For 2 of the membership plans, users are redirected to a Safecracker "profile manager". Users remain logged in and are able to access the profile manager. The profile manager has a check {if logged_out} to redirect them to the sign in page, if needed.
  5. For 1 of the membership plans, users are redirected to the EE control panel (/system/).

PROBLEM: users who picked the membership plan in #5 are prompted to log in at the EE log in page. It's as if they aren't logged in anymore. Users can still log in using the credentials they signed up with, though. Any ideas what might be wrong?

In all cases, once the user selects a membership plan, they are redirected to the "profile manager" template that has the following code:

{if logged_out}
    {redirect='/sign-in/'}
{/if}

{exp:membrr:not_subscribed}
    {redirect='/membership-plans/'}
{/exp:membrr:not_subscribed}

{!-- Redirect to EE CP --}
{if group_id == '8'}
    {redirect='/system/'}
{/if}

... profile manager template stuff down here ...
1

It could be that the URL is switching between http://www.domain.com and http://domain.com.

If this is the case, you need to set a "Cookie Domain" on the Cookie Settings page.

FROM THE DOCS:

This preference allows you to set your cookie domain. The vast majority of people will want to set this to:

.example.com

Obviously you’ll use your actual domain name instead of ”.example.com”. Note the period at the beginning as it is very important. Setting the cookie domain like this will allow the cookies to work regardless of whether people specify your URL with the www part or only the http:// part.

If you want to restrict your cookies to a single subdomain then you may set that here as well:

.subdomain.example.com

| improve this answer | |
  • 1
    Good answer Anna, I meant to include the different subdomain thing in my answer too, but somehow it seems to have gotten lost between my brain and my fingers ;) – UltraBob Jan 7 '13 at 4:04
  • That happens to me all the time! – Anna_MediaGirl Jan 7 '13 at 4:06
  • I'll look into this soon. I didn't think I was switching domains, though. Is it also an option to just to make sure I am redirecting without switching domains? Maybe redirect to {site_url}/system/? Also, if this were the case, why am I not having the same problem when I redirect to my profile manager template? – ExpressionEngineNewbie Jan 7 '13 at 4:10
  • Yes, removing the redirect, if that is indeed what is happening, will stop the problem. I don't know enough about your template code to answer you second questions. – Anna_MediaGirl Jan 7 '13 at 4:28
  • @AnnaBrown_MediaGirl - I wasn't suggesting to remove the redirect. I still need to redirect to the CP. I was thinking of making it an absolute URL instead -- in the event I was somehow changing domains. In any case, I came from a non-www domain and got redirected to a non-www domain. I added Cookie Domain per your suggestion. Still not working as hoped. – ExpressionEngineNewbie Jan 7 '13 at 5:48
0

Is it possible that the page they start out at is an http page, and when they get sent to the control panel they are switched over to https? This could cause them to suddenly not be logged in again.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.