First I'm setting the string value after user login in login.html page:
success:function(data){
if(res.IsSuccess){
localStorage.setItem(token,data.Response.AuthToken);
window.location.href=/dashboard.html;
}
} Once this is success it is redirecting to dashboard
On the dashboard page, I'm retrieving the value like this:
var Authtoken=localStorage.getItem(token)
How to check if the Authtoken value exists or not?
More explanation:
I'm storing the localStorage value from the server response, so in Serverend the authtoken expire time is 10min.
Login page
once the user click on RememberMe, at the time only I'm storing textbox values using localstorage to redirect to the dashboard next time without login(BrowserAction Icon click)Once I click the login button I'm storing the authtoken
localStorage.setItem(token,data.Response.AuthToken);
If the dashboard based on localStorage value, how to check if it exists or not?