-
- 51 Posts
I have a pure PHP page which is viewed "alongside" my modx site. Yeah, I should incorporate it, but it is pretty complex, it works and I don't want to fix something that isn't broken.
Is it possible to get the User ID via an existing session?
If not, I guess the solution would be to set a session var at login and then access it like in my PHP page.
Or is there a better way?
Yes. You can have your PHP page make an AJAX call to a MODx resource that has a snippet to return the user ID, and any other user data you want. That's how the Vanilla AJAX single-sign on works.