tags:

views:

64

answers:

3

I've seen a few instances now where web applications are letting try them out without you having to sign-up (though to save you need to of course).

example: try at http://minutedock.com/

I'm wondering about doing this for my own web app and the fundamental question is whether to store their info into sessions or into a temp user table?

The temp user table would allow logging and potentially be less of a hit on the server, correct?

Is there a best practice here?

+4  A: 

It should work exactly the same way the application usually works, with the only difference being that a flag like thisIsATrialUser is set. You shouldn't create two different ways to do things internally.

deceze
Exactly +1. Maybe `isTrialUser` communicates effectively enough, and is shorter too. :)
alex
@alex I like to be verbose in examples. ;)
deceze
thanks. i'll take that approach in conjunction with writing the app in a more OOP manner. At the moment it's a bit cobbled together
Mat
+2  A: 

Create a class of user, lets call it your Anonymous User Type. Give all unauthenticated users anonymous accounts (you have to clean up old accounts at some point). Use a persistent cookie to associate old users with their anonymous account. Make them authenticate themselves whenever they need to perform something that requires payment or full registration. Change their user type to something like Regular User Type once they are authenticated so you can keep all the information that was already attached to them when they where anonymous.

This allows tracking and storing of potential information like shopping carts without requiring registration upfront. Your code shouldn't have to change much if you treat anonymous user similarly to regular users. Otherwise you have to create an entirely new set of code to manage special users that are not stored in your master user table.

BeWarned
A: 

To clean up the data added by trial users, you can create a script to delete all the data that was created lifetime of cookie + 1 day and owned by any trial user. You can auto-pilot the script with nightly cron.

gsharma