eCommerce sites want to make their usersâ€™ experience as convenient and intuitive as possible.Â One convenience found on most major eCommerce sites is remembering what the user put in his shopping cart, even if that person didnâ€™t log in.Â Therefore when the user returns to the site he will see what he left in his shopping cart.
ATG makes it relatively simple to do this by:
- creating a profile in the repository (database) for all users that visit the website
- automatically logging in users by cookie
Therefore if a user returns, she/he will be automatically logged in and if there were any items in his cart they will be added to the current cart.
- Turn on persisting anonymous profiles in the ProfileRequestServlet.
# /atg/dynamo/servlet/dafpipeline/ProfileRequestServlet persistAfterLogout=true persistentAnonymousProfiles=true
- Turn on auto-login by cookie and turn off auto-login by basic authentication.
# /atg/userprofiling/CookieManager sendProfileCookies=true # /atg/userprofiling/ProfileRequestServlet verifyBasicAuthentication=false
- Make all profile properties not required except for login and password in userProfile.xml.Â Also make autoLogin true.
When a profile is created for an anonymous user the login and password are set to the userâ€™s ID (i.e. the profileâ€™s repository ID).
If you are adding this functionality to an existing up and running site you may have to modify your user tables so that there no â€œnot nullâ€ columns except for the id, login and password columns, you can leave those as how they were.Â Also you will need to set auto_login to true for all your existing users.
update dps_user set auto_login = 1;
To determine when the anonymous user was created look at the registrationDate profile property.Â To determine when was the last time the anonymous user logged in look at the lastActivity profile property.Â Both of these are updated by ATGâ€™s TrackActivity scenario which is in the DSS folder.
Finally doÂ not turn on persistent anonymous profiles in the BCC. It will stop working if you do that.