Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

TimiAde's avatar

How to Generate Unique Keys

I am building a quiz app for schools. and i want the school to generate unique keys(which they will use to take the quiz like login key) maybe ten chars for each student which will expire in 24 hours. Please how can i go about it

0 likes
6 replies
TimiAde's avatar

@Sinnbeck will it always be unique and also how can i use it in a login form to enter the quiz page. My idea is the student enters the key then the user and submit then it checks whether it is in the database then the quiz page opens. Am i right?

Sinnbeck's avatar

@TimiAde I use it for dropoffs. People get an email with that uuid in the url. /pickup/{uuid}

And yes it's unique

TimiAde's avatar

@Ben Taylor cant i set the uuid in the database to expire after 24 hours. Because the teachers will give the student the uuid keys during computer practical to practice the quiz on their systems

Please or to participate in this conversation.