0

From JavaScript loaded via a static HTML5 file [loaded from a Joomla page element's onClick event and window.open()], does an AJAX request to a PHP script inherit the session context such that JFactory::getUser() returns the currently logged-in user?

0

Short answer is yes.

From the browser side, any request, ajax or otherwise, will, by default, include the cookies for that domain. The window, the javascript, the onclick event, the staticness of the html, are irrelevant.

From the server side, the session cookie will be processed by the session handler if the joomla application is loaded.

There are exceptions to both of the above but usually you have to do some work to stop the session from working normally.

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.