Hello,
I have written some mods to DNSF to handle some interesting functionality.
-I have to capture QS vars coming in from affiliate banners out there (affiliateID, ItemID-which crosses over to a productID in DNSF.)
-Then, let the customer create an account (suppressing the billing/shipping info)
-After account creation, post some of the data to an outside payment processor/affiliate system(data includes info forDNSF to handle a return completed purchase from this external source, eg: DNSFCustomerGUID gets passed)
-The payment processor then posts a completed order to DNSF's orderconfirmation.aspx page (that I modified to handle the return...)
I've learned (so I think) that when logging a user in, one must use the CustomerGUID as the cookie name. this might be the problem... Following signin.aspx lead I see that I use the CustomerGUID:
Code:
string cookieUserName = CustomerGUID.ToString();
bool createPersistentCookie = PersistLogin.Checked;
string sReturnURL = FormsAuthentication.GetRedirectUrl(cookieUserName, createPersistentCookie);
FormsAuthentication.SetAuthCookie(cookieUserName, createPersistentCookie);
HttpCookie authCookie = Response.Cookies[FormsAuthentication.FormsCookieName];
authCookie.Secure = false;
Since the 'affiliate banners' and the 'returned completed order' can return to any page,(outside our control) I've put some code in Global.asax and some in createaccount.aspx and orderconfirmation.aspx.
Here's the issue:
the relevant code in Global.asax is as follows---(this is after I collect the querystring vars)
Code:
//log the user back in
string FixedCustomerGUID = Session["CBCustomerGUID"].ToString();
FixedCustomerGUID = FixedCustomerGUID.Replace("{", "").Replace("}", "");
FixedCustomerGUID = FixedCustomerGUID.ToLower();
FixedCustomerGUID = FixedCustomerGUID.ToString();
FormsAuthentication.SetAuthCookie(FixedCustomerGUID, true);
HttpCookie authCookie = Response.Cookies[FormsAuthentication.FormsCookieName];
authCookie.Secure = false;
Response.Clear();
//update this location to reflect the custom CB purchase procedure's needs
Response.Redirect("orderconfirmation.aspx", false);
THe problem is that when I'm building the SQL string for inserting th ecompleted order info into the relevant tables, ThisCustomer.whatever isn't filled in with the customer's data...
I guess the question is, am I loggin them in right in Global.ASAX?
FYI: I tried moving the code directly to the orderconfirmation page and get the same results...
I am under the assumption that DNSF defines ThisCustomer via the GUID supplied in the .setAuthCookie portion of FormsAuthentication.SetAuthCookie(...
Am I missing something to log someone in? Should I be using UserID? EMAIL?...