I have a table storing userdata in MySql and along side other info it stores pictures(LOAD_FILE()) as BLOB. I take an image from user check its format and then using move_uploaded_file() rename it to session_id() and insert the info in table.
My Question: Is session_id() unique for all the session that are active at the movement across different devices accessing this site so that my image doesn't get overwritten.
If not, is there a better way of achieving this?
I am asking this question because this site may be used by many clients simultaneously in future and it's better to prevent a bug from happening.
Php version: 5.5.14
<?php
//rest of code
if($ext){
$_SESSION["image"] = session_id().".".$ext;
move_uploaded_file($_FILES['Pro_imgInp']['tmp_name'],$_SESSION["image"]);
echo "Uploaded image: ". $_SESSION["image"] . "<br>";
$_SESSION['ext'] = $ext;
}
//rest of code
?>