session: fix retrieval of local sessions if app is detached