restorePreviousSession returns to the wrong app

I’m experiencing some caching issues somewhere in the Solid apps that I can’t track down. I have made in the last weeks two apps:

When I open a private browser tab and login in one of the Apps and then try to open up another private tab to the other app always I get redirected to the first . E.g. open AcmeBase , login , open in a new tab WACEditor and you get redirected to AcmeBase.

I have no idea how to prevent this behavior. Both apps need restorePreviousSession. Is this a programming error? Browser cache? Server cache?

I exprience this both on Chrome and Firefox browsers.

1 Like

I think it is related to this issue: solid-client-authn-browser should use storage abstraction for storing a current session or offer control of a namespace in the localstorage · Issue #2095 · inrupt/solid-client-authn-js · GitHub

I’m no developer of this library (so it may be wrong), but I think it always uses the same key for the local storage session restore. So if you have two apps on the same domain, they share the localStorage and thus access and write to the same data there

You are not doing anything wrong, this is a known issue: Host several applications under the same origin · Issue #1647 · inrupt/solid-client-authn-js · GitHub

You unfortunately either have to host your apps on seperate domains, or disable restorePreviousSession :frowning:

1 Like

@aveltens is correct: unfortunately, at the moment, hosting several apps is not supported on a single domain.

It would be really good if that was supported because i build all my app like that and don’t want to buy a domain for each of my prototypes apps/ test

I’ve never seen an identity provider working like that. User should always be redirect to the page he logs or session restore should detect the user is connected on this domain and current session should be loggedin when he arrives on the second app

Ok thanks all. I got it working by creating a custom (sub)domains for each app in github pages.

If you already own an own domain (e.g. patrickhochstenbach.net for me), then adding endless CNAME aliases doesn’t cost anything extra (expect for some typing adding those names). In the DNS server add something like : <yourapp>.patrickhochstenbach.net CNAME phochste.github.com where the names are changed to your own project/app. And in github pages add a custom domain.

2 Likes