How to keep login session when refreshing page in SPA

A post was split to a new topic: Authentication is lost after page refresh