Search code examples
asp.net-mvcc#-4.0google-checkout

Read session or cookie on CallBack


We have ASP.NET MVC 3 application which is integrated with Google Checkout API. Is there a way to access Session or Cookie of the Site on Google Checkout CallBack?

Suppose, I have logged into my site with UserID: ramiz and Password: r@miz. After I provided my credentials on Login it collects more details about me and put them in session (like, First and Last Name). Once I get in, I see a list of (used) iPhone. There, I see a cheap deal offering iPhone 3G only $150. There is a button of "Buy Now" in front of that deal. I click on this it ask me some more data and finally take me to the Google Checkout to do the transaction and place the order. I did and it shows me a "Thanks" message which means the transaction is completed successfully.

When we checkout Google calls our defined CallBack URL where we can collect the Nofitication XML which has Order Details. We are getting that Notification XML and happy to see all details is in there which we required. Here, we need to access the user Session or Cookie to get his First/Last Name and UserID. We have tried to access the Session/Cookie but it seems fail.

How do we have access Session or Cookie here? Or is there any good way of doing this?

Thanks.


Solution

  • Cookies (including session cookies) can only be accessed if the client (browser) actually goes back to your web site (if they do).

    You can look into storing the data in:

    1. merchant-private-data (order level)
    2. merchant-private-item-data (item level)

    instead of cookies. These will be echoed back to your handler in new-order-notification.