When mod-rewrite mode isn't enabled all links created by In-Portal looks like http://www.domain.tld/?env=sid-template:m-.....
When mod-rewrite mode is enabled same link would look like http://www.domain.tld/template.html?sid=sid.
If you started to use In-Portal with disabled mod-rewrite mode and then, after some time, enabled it you might get into situation when visitors are coming on website using both old (with ?env=) and new (without ?env=) style links.
This usually happens, when visitors (or spiders) have bookmarked links when mod-rewrite was disabled.
To solve that problem In-Portal does automatic redirect to mod-rewrite equivalent of every non mod-rewrite link it encounters.
And during that redirect happens fatal error caused by accessing kApplication::Session attribute from kApplication::RecallVar method, since session isn't yet initialized when In-Portal decides to do that redirect.