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?
1 Answer
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.