Hi Beffic,
Thanks for the link that helped me a lot to understand your system. The problem here is JS 🙂
If i understood it correctly,
when i press login button, in the background your checking the logins and send a javascript function name (if a successful login) and eval that from client side.. rgt ?
the problem here is when some one pressed F5 after logged in, the server will send the same html file which it sent before the login. the problem with that is, that HTML doesnt contain any function call to tell the browser that this guy is already logged in and run the logged in function instead of showing the index page content.
in-order to solve this what you need to do is add some code to the index file it self.
<script language="javascript" type="text/javascript">
$(document).ready(function(){
<?php
if(!isset($_SESSION['userid'])){
print 'function you call after a successful login to render the page();';
}
?>
});
</script>
so now when a user hit F5 the page will comes with the function to reload the page with appropriate data.
Only change here compared to my previous code is we are calling the actual function to replace the html with the logged in area instead of goLogin()
hope this helps,
Best regards,
niroshan