For the logged-out user the behavior seems to be correct.
The logged-in user losing the session seems to be a bug and I suggest filing a ticket for this with Mendix support.
I would expect that the homepage is not hit when using these links as you are accessing the application on a separate requesthandler (/p/) that will not redirect to the homepage.