{aabox}

Description

Returns the text OK when the current request has opened an AA session, and an empty string when it has not. Whether a session is open depends on how the page is served: view.php and slice.php open one on every request, and so does every admin page; a page of the Site module opens one only for a visitor who already has the AA session cookie, for a login sent with this very request (on a site that uses the SEO router), or once the page has rendered something that needs the session, such as formantispam with a slice id. For an anonymous visitor of a site page - the usual public visitor - the result is usually empty. A site page is also kept in the page cache, and a visitor with the cookie who is not logged in shares the cached copy with anonymous visitors, so on a site page either of them may get the result rendered for the other. In view.php output, slice.php and the admin the result is always OK. It is not a login check: a session can be open for a visitor who is not logged in. The command takes no parameters and changes nothing.

Examples

virtual[{aabox}]
Expected([OK] in view.php output, slice.php and the admin; [] for an anonymous visitor of a Site module page)
Actual[]
Illustrative, because the value depends on how the page is served. This documentation page is a Site module page, so an anonymous reader sees []; the test suite renders through view.php and gets [OK]. The brackets are literal text that make an empty result visible.
virtual{ifeq:{aabox}:OK:session open:no session}
Expected(session open - in view.php output; no session - for an anonymous visitor of a site page)
Actualno session
Compare the result as text with ifeq. Do not use the if command here: if compares numbers, and both OK and the empty string count as 0 there, so it would always take the first branch.
test{ifeq:[{aabox}]:[OK]:OK or empty:[]:OK or empty:something else}
ExpectedOK or empty
ActualOK or empty
The result is always either OK or an empty string, on any page. This check holds in both contexts, so it is the asserted test of the command.