Navigation history
Monti can remember the last 10 GET routes visited during a session, useful to build "go back" links, wizards, or any flow that needs to know where the user came from. This is handled by two static methods on \Session, the same class described in the Sessions documentation.
How it works
Every time a route's handler finishes and produces a response, the framework checks whether that response is a redirect. If it isn't, the route is appended to a list kept in the session, capped at the last 10 entries. Since the entry is recorded only after the handler has run, and only for a page the user actually saw, -1 always refers to the page the user came from.
Only GET routes are tracked, since POST, PUT, PATCH and DELETE requests don't represent pages the user can go back to. Visiting the same URL twice in a row doesn't add a duplicate entry either.
Reading the history
\Session::get_history(); // full history array (oldest to newest)
\Session::get_history(-1); // the page the user came from
\Session::get_history(-2); // the one before that
An index that falls outside the array, in either direction, simply returns null.
A practical example
A common use is a link that survives the current request, for example right after switching the interface language: