I’m creating an online quiz. How do I create a unique ID for the user without having them signup? I would like the user to click “Start” and this would create the user with a unique.id.
The unique ID is an automatically generated value that you can’t manipulate directly, so there’s no way to create one before the user itself is created.
However, current user is available even if your visitor hasn’t actually registered. This is to make sure that you can save data on the user before he registers (for example, most webshops allow you to add items to the cart without registering a profile first).
All info saved on that temporary user will be transferred to the new user profile once it’s created, so in your case, you can keep a score, a nickname, etc, temporarily.