digitalpoint
Well-known member
The session is never guaranteed (in the pre_dispatch listener or otherwise). Even the standard XenForo_Controller::_setupSession() method checks to see if the session is available before it tries to do anything with it.
As far as checking if the session exists in pre_dispatch not working or not having any affect, that's absolutely incorrect. This works perfectly fine within the controller_pre_dispatch listener:
PHP:
if (XenForo_Application::isRegistered('session'))
{
$session = XenForo_Application::getSession();
// do whatever you want to do with the session.
}
Nothing in the registry is guaranteed... it's the whole point of having things like the isRegistered() and getWithFallback() methods.
Either way, session (and other registered items) isn't always there... which is why you need to check to make sure they exist before trying to sue them (same thing with "cache", but that's more common to not be available since it's not even enabled by default in XF).
Right... it's not supposed to be a static file. Just like the URI of "community/threads/better-analytics.58746" here isn't a file either.No, as I said it ( /misc/a.js ) is not even on my server and not in your install package.