November 3rd, 2011, 01:34 PM
Welcome Back Message
How do you code a 'welcome back' message that only displays after the first visit? I'm trying to do it using <cfapplication> and session variables, but I can't figure out how to know when a session has ended. I'm also trying to save info with their CFID in a database...
November 3rd, 2011, 04:19 PM
If they don't log in (where you would have a unique user Id to identify the user) there's really no way to be sure which user it is. You can't use the CFID because those are session identifiers (which aren't necessarily going to stay the same).
You could store something in a user cookie with the date of the last visit, and show the welcome back message if you find that they have already visited. Or you could store their IP address in the database. Neither is always going to work but they would work in most cases.