Double Login with websiteMembership

Hi pgplast,

When you say that you have separate logins, I am assuming you have set the WSM_SEPARATE_LOGIN global variable in websiteMembership.php to "true". This means that logging into CMSB is going to be a separate login than trying to login to pages that are protected by websiteMembership.

Your code there is testing for the websiteMembership login "CURRENT_USER" and if not, redirects them to the login page. 

From what I am understand as to what you are saying, the user logs into CMSB as an admin, clicks a link which takes them to that page protected by websiteMembership. There it sees that CURRENT_USER is not set, so immediately redirects the user to the login page. Because the user has logged into CMSB doesn't mean they skip login for the page protected by websiteMembership (when using separate logins).

Am I understanding the process you are going through here? If not, any further clarification would help.

Thanks!

Tim Hurd
Senior Web Programmer
Interactivetools.com

Yes, Tim. You have it correct. Are you saying that setting $GLOBALS['WSM_SEPARATE_LOGIN'] = false;  will allow a logged in backend user to avoid a second login on a websiteMembership protected page?

By pgplast - Yesterday at 2:15pm - edited: Yesterday at 2:16pm

I set it to false and that has eliminated the second login. 

I guess I have been misunderstanding the setting itself. For what purpose do folks use the "true" setting of  $GLOBALS['WSM_SEPARATE_LOGIN'] ?

Oh good, glad that has helped. 

There might be various uses for it to be separate login. When enabled, the two login sessions are completely separate. You can be logged into CMSB and separately be logged into the front end as a different user. Maybe you are a CMSB admin doing some work in the back-end as an admin, but you want to login to the front-end as a normal user to see what they see. When set to false the CMSB user and the front-end use the same login space.

The practical effect of setting it to false is that if you log into CMSB admin, you'd also appear logged in on the website front-end. Of course it doesn't mean that a websiteMembership user could access the CMSB back-end because there are still permission checks etc. in place.

Hopefully that makes sense. :)

Tim Hurd
Senior Web Programmer
Interactivetools.com

Thanks, Tim.