last_insert_id è sicura? Si.
Quel valore che si ottiene è realmente legato all'ultima query effettuata dall'utente corrente.