http://165.232.48.178/zfrikadev/Kenya if I try to click on a category to make a new post, it asks to login again -kangi.
kangi
1
urgent
important
customer feedback zfrika
user is in /zfrikadev/accountant?country=sxxxx ->if they select "New". check if they are logged in. If they are logged in then take them to "Post" if they are not logged in take them to login. in the href = create a function that checks if datatoken is defined if datatoken is defined. then
function checkstatus_before_redirect(){ datatoken= sessionStorage.getItem('datatoken'); if(datatoken) { console.log("dataoken found--1"); window.location.href = "http://165.232.48.178/zfrikadev/addnewpost/"+datatoken; } else { console.log("datatoken not found--1"); window.location.href = "http://165.232.48.178/zfrikadev/login"; } } <a onclick="checkstatus_before_redirect(); return true;"