-
- 195 Posts
Hi,
I've two MODX installations running on a main domain name (2.2.5PL) and one that's on an addon domain name (2.2.6PL), same webhosting. I'm using Mark Hamstra's code to detect a user is logged into the manager from the front end. The one I installed on the my site works fine. The one on the addon domain doesn't. Same code. I was trying to debug and see what user was being detected in the front end (while I'm logged into the manager). Echoing $modx->context->key returns "web", and the user as anonymous. Is this a bug? Any other methods of detection I can try?
-
- 195 Posts
Bump.
Anyone?
This essentially means no manager detection in my case... Really odd problem here..
Try putting in a debugging snippet that will output the entire SESSION with code something like this:
<?php
echo "</pre>";
print_r($_SESSION);
echo "</pre>";
return;
-
- 195 Posts
Hmm.. blank.. as in nothing in between the pre tags..
-
- 195 Posts
Well, that solved my other problem - hiding analytic tags for manager users. The other thing that's still baffling me is why I can't seem to view unpublished resources (frontend preview) as a manager... It always throws me to my homepage.
As far as I know, you can't use session.auto-start with MODx, because MODx starts its own session on every page request. If you are using a default PHP session, then you won't get the MODx stuff. Also, MODx stores sessions in the database instead of using the default PHP filesystem storage.
Are your manager and website on different (sub)domains, perhaps? Sounds like it may not be sharing the session cookie.
-
- 195 Posts
They're both on the same domain. I'm using an addon domain if that matters (Didn't have an issue like this with regular domain and webhosting setup.)
sub.domain.com does not count as the same as domain.com or www.domain.com as far as sessions go.