I have the following php scripts which creates a random string of characters as "Token" and it's then stored in a session called "ajaxToken". What I would like to do is to add more security by expiring this session after some time and enforce it to generate a new one. Is there a way of doing it that? Note: I have the session_start();
in another php page.
<?php
$token = substr(str_shuffle(MD5(microtime())),0,20);
$_SESSION["ajaxToken"] = $token;
?>