All I want is a form field that requests visitors email address when they want to watch video clips, and then once they enter their email once, they get immediate access everytime them visit our site. JPost.com is set up that way. You can read the headlines, but the first time you want to read an article, they ask for your email. From them on, everytime you visit their site (unless you delete cookies) you get immediate access.
This page demonstrates how a cookie can be set to track a browser's visits. Cookies are set containing a unique identifier, the total number of visits, the last visit, and a custom text field that the visitor can assign. In an application, the text field could be an e-mail address, for example. Validation is applied on the cookie and form variables to prevent query injection and cross-browser/cross-site scripting attacks. Values go away if cookies are cleared, of course, and a visitor would need to reset the custom text in every different browsing client. Otherwise, the cookies are set to persist for a year.
I have also developed a more powerful tracking system with a database backend.
| Unique Identifier | 777b2cb8acc301c4cb04dd670a5cb4ae |
|---|---|
| Total Visits | 1 |
| Last Visit | never |
| Custom Text |