6 Replies Latest reply on Sep 12, 2013 6:21 PM by ClareR-Oracle

    Related to cookie

    pveedu1

      Hi all,

       

      My requirements is  mentioned below .

       

      I go through a site as an anonymous user ,then i selected  a store that  values  is going to keep in cookie after that I login to site that time i need to copy this value from cookie to login profile.

       

      could you please tell how it will implement in atg,.

       

      Thanks,

      P

        • 1. Re: Related to cookie
          Gopinath Ramasamy

          Hi,

           

          Your requirement can be achieved without the cookie approach.

          Please check the propertiesToCopyOnLogin property in the below link. This has exactly what you are looking for.

           

          Oracle ATG Web Commerce - ProfileFormHandler Properties

           

          For more details on the cookie approach or on the usage of cookies and ATG's Cookie manager, please refer to the below links.

          Oracle ATG Web Commerce - Tracking Users

           

          http://docs.oracle.com/cd/E22630_01/Platform.1002/apidoc/atg/userprofiling/CookieManager.html

           

          Hope this helps.

          Keep posting the updates / questions.

           

          Thanks,

          Gopinath Ramasamy

          • 2. Re: Related to cookie
            pveedu1

            Thanks Gopi.

             

            But one thing  in my application i am persisting anonymous profile.so all annonymous profile  values will directly copy into signed user profile.is it correct?  then there is  no extra configuration is required ,i mean propertiesToCopyOnLogin etc. could you please update me if i am wrong.

             

             

            Thanks,

            P

            • 3. Re: Related to cookie
              Gopinath Ramasamy

              Hi,

               

              You would need propertiesToCopyOnLogin if you want to override the permanent profile properties with that of the anonymous user.

               

              Otherwise you are good.

               

              Hope this helps.

               

              Thanks,

              Gopinath Ramasamy

              • 4. Re: Related to cookie
                PrincessPoonam

                @pveedu1,

                 

                Once you login, your profileId will change, you will have the profileId that was created when you registered for the first time in the site.

                Even if you r persisting the profile of annonymous user, once you log in/signin you will have the profileId that was created when you registered.

                 

                 

                Pls correct me if i am wrong

                Thanks

                • 5. Re: Related to cookie
                  pveedu1

                  Thanks.

                   

                  But i don't  want to override the existing values instead of append the existing values.

                   

                  propertiesToCopyOnLogin will oveide the existing value. so how i will do this functionality?

                   

                  Thanks,

                  P

                  • 6. Re: Related to cookie
                    ClareR-Oracle

                    ProfileFormHandler has another property named propertiesToAddOnLogin that you can use to merge values for properties that implement Collection, Map, or are arrays.  Values from the anonymous profile may be added to the login profile or may override values in the login profile, depending on the property data type and the actual values.  For example, if a property is a Map and both profiles contain the same key, the value from the anonymous profile will win.  Collections are combined via addAll.  Maps are combined via putAll.  For an array property, anonymous values are appended to the login values.

                     

                    If you need to do anything fancier in terms of combining values for some property, you can extend ProfileFormHandler (or CommerceProfileFormHandler or other class you're using) and override the copyProperty and/or addProperty methods.  In your override, you can look at the property name that's passed into the method and execute whatever logic you need for the properties you care about.