Add better support for afs:sort query parameter
Manage natively user and session ids