The data comes from the form (announcement), written in $_POST . Then recorded in the session:
$_SESSION['ad'][time()] = array( 'private' => $_POST['private'], 'seller_name' => $_POST['seller_name'], 'email' => $_POST['email'], 'phone' => $_POST['phone'], 'location_id'=> $_POST['location_id'], 'metro_id' => $_POST['metro_id'], 'category_id'=> $_POST['category_id'], 'title' => $_POST['title'], 'description'=> $_POST['description'], 'price'=> $_POST['price'] ); The uniqueness of the recording in the session is provided by the time() function. But here is one "but": if two announcements arrived at the same second, only one announcement will be recorded.
And finally, the question: how to ensure the uniqueness of each declaration without the time() function, or how to replace the time() function?