'Should I store the User Registration Agreement Checkbox in the database

I am using codeigniter and have a registration form that captures basic info such as email, username, and password. I will also have a Terms of use checkbox that will need to be checked in order to complete the registration.

My question is should I be storing this in the database? If so, should it be stored as a bit (1,0)?



Solution 1:[1]

Unless the policy will never change, you should track the timestamp of agreement or version of the policy agreed to at the time the user clicks the button. Then when you update the policy you increment the version (or store the policy itself in the DB and use a created/updated timestamp). When the user logs into the system again you check the time/version agreed to and the current time/version of the policy and determine if the user has agreed to the latest version.

If you don't do it this way and you ever change the policy, you will have to force every user to agree to it every time they log on to ensure they have agreed to the right version. Otherwise they can use the argument, "That's not what it said when I agreed to it."

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 WillyC