I am trying to create an HTML link that changes the PHP session id. Basically I need to call the session_regenerate_id(); when a link is clicked. The problem is that it can’t run on the page that I am linking to. There is an upload form that reloads after upload so the function cannot be on the page I am linking to.
Can I do an AJAX post to a separate PHP file?
In your php file called regenerate.php:
<?php session_regenerate_id(); ?>And then with jquery.
Then to run it: