Thanks for getting back to me on these 2 issues... I will try to do what you're saying but how do I save the ID of the last inserted login entry in a session to delete it?
In fact, if I can get that ID, then I won't have to delete it but simple update it to 'failed', no?