I'm storing the session_id() value in a database and I have set attribute "unique" for this field. I have a form and the users can log in but when they use the back button of the browser or they logg twice without closing the browser, they get a Mysql error message of "duplicate entry". Is there a way to customize this message or to send them to another page?
Do a select from your database table to see if the session_id() value is already in the database table.
If it is not there, you can safely do your insert. If it is in there, you can send them to another page.