[ticket/12834] Fix tests to match what we want to have

PHPBB3-12834
[ticket/12834] Correctly match directories in session page

Also clean path before working with it

PHPBB3-12834
Merge remote-tracking branch 'nickvergessen/ticket/12834' into develop-ascraeus