How to write to $_session argument of the functions JS?

I want to pass 5 through a js function onEdit() as arg_id, and then I have to write down the value of this arg_id session how to do it?

<a onclick="onEdit(5)"> Edit </a>
and
function onEdit(arg_id) {

 <?php $_SESSION['objID'] = arg_id; ?>
 alert('id = '+arg_id+' phpid = <?php echo $_SESSION['objID']; ?>');
}
June 10th 19 at 15:18
1 answer
June 10th 19 at 15:20
When you click on a link to trigger an ajax which refers to the php file.
Php records session

Find more questions by tags PHP