1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Integrating Shopping Cart into Sitefinity

Integrating Shopping Cart into Sitefinity

6 posts, 0 answered
  1. Shawn
    Shawn avatar
    10 posts
    Registered:
    09 Jan 2009
    09 Jan 2009
    Link to this post
    Hi guys,

    I've got a difficult one for you. 

    We are trying to integrate a shopping cart system into Sitefinity as UserControls.  We would like a user to be able to login to the cart system and be logged into Sitefinity (for forums, blogs, etc) and vice-versa, when user logs in to post to forums/blog/etc, they are then also logged in to their shopping cart. 

    After some investigation it appears that both Sitefinity and the shopping cart system (Iciniti) are using the FormsAuthentication cookie to store their logged-in user.  So, when I log into Sitefinity's login control, the Auth Cookie is Sitefinity's and so the shopping cart thinks it is not logged in.  Then when I log into the shopping cart it re-writes the Auth Cookie and Sitefinity is no longer logged in.  This all seems normal to me. 

    My million dollar question is:
    Do you know of a way around this in Sitefinity?  Is there a way i can trick Sitefinity into believing it is logged-in even when it the Auth Cookie is being used by a different technology?

    I really appreciate ANY help you can give on this. 

    Thanks in advance,
    Shawn
  2. Shawn
    Shawn avatar
    10 posts
    Registered:
    09 Jan 2009
    09 Jan 2009
    Link to this post
    Hi again,

    After further research and dissecting the AuthCookie, it appears that .Userdata is being set to "Sitefinity" and if I add any extra data to that string Sitefinity rejects the cookie and thinks it is not logged in. 

    Does Sitefinity specifically check that value and .RedirectToLogin() if it is incorrect? 

    I was hoping to combine the Sitefinity AuthCookie and the shopping cart's AuthCookie into one and maybe satisfy them both!!

    Also, for the record, both Sitefinity and the shopping cart system set HttpContext.Current.User.Identity.Name to the username of the logged-in user and I have made this username the SAME in both systems so when they use that value to get user information they will work correctly.

    Thanks again,
    Shawn
  3. Mike
    Mike avatar
    208 posts
    Registered:
    10 Dec 2007
    09 Jan 2009
    Link to this post
    I can't answer your direct question, but I've spent the last month or two trying to get CommerceFinity (which was based on the CommerceStarterKit) to work nicely with Sitefinity in a similar way, so that controls can be dragged onto a page, and everything work within Sitefinity.  I'm using the Products module (with a lot of customization) as the primary catalog for the user, which gives me some really cool features for navigating the catalog.   And the flexible meta-tagging is really handy.

    Anyway, I think you're better off using a common authentication provider for both.  That's the main reason I chose CommerceFinity (though I'm tearing my hair out because of other reasons, now).  Even though I'm having lots of other problems, at least the authentication part works. 

    Regards,
    Mike Sharp
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    23 Jan 2009
    Link to this post
    Hello Mike,

    I also think that the Mike's approach.
    Please follow up if you were able to resolve the issue.

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Shawn
    Shawn avatar
    10 posts
    Registered:
    09 Jan 2009
    23 Jan 2009
    Link to this post
    Hi Georgi. 

    I have solved the issue by overriding the Shopping Cart's User class. 

    In the class, I override their Authentication process and have it simply check if Sitefinity is logged in.  Then, when a customer code is available from the Shopping Cart's accounting piece (after the user buys something) I grab that code and store it in the Sitefinity user's Profile.  This attaches a Sitefinity user to a shopping cart customer.  Seems to work great!  Hope this helps.

    --shawn
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    26 Jan 2009
    Link to this post
    Hello Shawn,

    Thank you for your prompt reply. It is good for us to know about this solution.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
6 posts, 0 answered