javascript - keep local or session storage between pages -


a newbie question here, have searched on stackoverflow , nothing has answered question...

i have home site lets homesite.com there have login , if went smoothly redirect user app.homesite.com there @ session or localstorage see if valid user

my question how can have session or localstorage saved? because when page changes url memory gone... testing pages locally localhost8808 , localhost9000 don't know if has that

localstorage saves data permanently until deleted developer or user . session storage available in current window . if using local storage , data clearing when url changes need configure domain :

example :

app.homesite.com/home

app.homesite.com/login

app.homesite.com/profile

ect...