Skip to primary content
Skip to secondary content

betweenGo

betweenGo

Main menu

  • Home
  • Blog
  • About me
  • Contact Us
    • Contact Form

Tag Archives: auto-login

Persistent Cart for Anonymous Users

Posted on May 3, 2010 by Frank Kim
8

129/365 Isn’t it iconic? on Flickr Isn’t it iconic? by Mykl Roventine

Convenience

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.

Persistent Cart

ATG makes it relatively simple to do this by:

  1. creating a profile in the repository (database) for all users that visit the website
  2. 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.

Implementation

  1. Turn on persisting anonymous profiles in the ProfileRequestServlet.
    [ruby]# /atg/dynamo/servlet/dafpipeline/ProfileRequestServlet
    persistAfterLogout=true
    persistentAnonymousProfiles=true[/ruby]
  2. Turn on auto-login by cookie and turn off auto-login by basic authentication.
    [ruby]# /atg/userprofiling/CookieManager
    sendProfileCookies=true

    # /atg/userprofiling/ProfileRequestServlet
    verifyBasicAuthentication=false[/ruby]

  3. Make all profile properties not required except for login and password in userProfile.xml.  Also make autoLogin true.
    [xml]<table name="dps_user">
    <property name="login" required="true" />
    <property name="password" required="true" />
    <property name="firstName" required="false" />
    <property name="lastName" required="false" />
    <property name="email" required="false" />
    <property name="autoLogin" default="true" />
    </table>[/xml]

Notes

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.

For further reading please see Tracking Guest Users and Tracking Registered Users in the ATG 9.1 Personalization Programming Guide.

Posted in Personalization | Tagged auto-login, ecommerce, profile | 8 Replies

Recent Posts

  • Django South Notes
  • Regular Expressions in Oracle SQL
  • Don’t always use GenericService
  • ATG Ordered One-to-Many Relationships
  • ATG Unordered One-to-Many Relationships

Recent Comments

  • Arun Yadav on Oracle TNS Listener service not starting
  • Ravi on Fixing Resource Already Exists on Disk Errors in Eclipse
  • Gowri on ATG does not allow property values with commas for String[] properties
  • Miguel on HOWTO Stop Being Prompted For Password in TortoiseSVN
  • val on HOWTO Stop Being Prompted For Password in TortoiseSVN

Tags

  • ACC
  • ATG
  • auto-login
  • bcc
  • bugs
  • CartModifierFormHandler
  • comcast
  • configuration
  • Cygwin
  • debug
  • dsp
  • Eclipse
  • ecommerce
  • foreach
  • fstab
  • ID generators
  • interview
  • j2ee
  • Java
  • JavaScript
  • JBoss
  • jhtml
  • JSP
  • JSTL
  • log4j
  • Logging
  • maven
  • mount
  • MySQL
  • Oracle
  • Perforce
  • Personalization
  • product catalog
  • Ruby on Rails
  • smtp
  • SOLID
  • sql
  • Struts
  • Subversion
  • svn:ignore
  • tag converters
  • transactions
  • virtualbox
  • WordPress
  • xml

Categories

  • Apache (18)
    • Commons (1)
    • HTTP Server (7)
    • Logging (4)
    • Maven (4)
    • Struts (3)
  • ATG (93)
    • ACC (8)
    • Commerce (16)
    • Configuration (9)
    • Form Handlers (6)
    • Nucleus (3)
    • Page Development (27)
    • Personalization (5)
    • Programming (7)
    • Publishing (2)
    • Repository (23)
    • Testing (2)
  • Consulting (4)
  • Database (35)
    • MySQL (6)
    • Oracle (30)
  • Java (51)
    • Hibernate (4)
    • Java SE (28)
    • JDBC (4)
    • JSP (13)
      • JSTL (10)
    • Servlet (1)
  • JBoss (6)
  • Miscellaneous (25)
    • Adobe (5)
    • Intuit (2)
  • OS (29)
    • Mac (7)
    • UNIX (11)
      • Bash (3)
      • Cygwin (9)
    • Windows (13)
  • Ruby on Rails (30)
  • Tools (34)
    • Eclipse (15)
    • Perforce (11)
    • Subversion (9)
  • Web (25)
    • JavaScript (6)
    • PHP (2)
    • Python (2)
      • Django (2)
    • WordPress (5)

ATG

  • ATG
  • ATG Documentation
  • ATG Java API
  • ATG Technical Forums

Blogroll

  • Meta Theory

Ruby on Rails

  • Highrock Store
  • Hoops For Orphans
  • Ruby on Rails

Technology

  • Version Control with Subversion
Proudly powered by WordPress