Php on load function..?
Php on load function..?
I'm using the following code, the problem is on each page load the token should generate random string, the string is generating in localStorage but when im using php code there is only one constant string which isn't changing.
- $(window).load(function(){
- $.post("SetSession.php",function(data){
- localStorage.setItem('token',data.Token);
- <?php $_SESSION['token'] = getToken(); ?>
- },'json');
- });