unset($_SESSION['id_act']);
Would be the correct code to clear it. However it should be updated with the insert, so I think there is another underlying problem that needs to be fixed. Removing the session variable won't help the problem that the session variable isn't being stored properly.