Extend Traditional Login Return Experience

The Standard Registration Flow displays a personalized message when a user returns: “Welcome back, Joe!”.

When a user uses a social login, a cookie named welcome_info_name is set, which expires in 5 years just like janrainLastAuthMethod. With a traditional login, the cookie is not used, and the message expires in an hour.

To extend the timeframe for traditional logins:

1. Add JavaScript Setting to Site

The new setting is:

janrain.settings.capture.returnExperienceUserData = ["array.of.dot.paths", "another.dot.path.to.value.in.janrainCaptureProfileData"];

This setting specifies what should be saved for a long time as localstorage or a cookie.

2. Add JavaScript Method

The new method to fetch a saved value is:

janrain.capture.ui.getReturnExperienceData(key, multiDomainCallback);

The key parameter is the required dot path string specified in the setting above to fetch.
The multiDomainCallback parameter is an optional function used when the data that is to be fetched is on a different domain. See returnExperienceUserData on the settings page.

Example

janrain.settings.capture.returnExperienceUserData = ["uuid","displayName","photos.0.type"];

janrain.events.onCaptureLoginSuccess.addHandler(function(result){
    janrain.capture.ui.modal.close();
    var name = janrain.capture.ui.getReturnExperienceData("displayName");
    var photoType = janrain.capture.ui.getReturnExperienceData("photos.0.type");
    alert("Hello " + name + ", you have a " + photoType + " photo, and even better, you just logged in!");
});