How to access the session/Cookie set in the web service by another Site:

enandunduff

New Member
I have a client application which will call the web method and pass two values (order and Amount).The web method will set the values in Session/Cookie. Now the client application will redirect to other web site, the web site should be able to get the order and Amount values either by Session/Cookie. I cannot use it as query string due to security issue. Kindly help me with a proper solution.The code in web service is as follows:\[code\] [WebMethod(EnableSession = true,Description="SetValues")] public void CallService(string orderNumber, double amount) { if (orderNumber != null && orderNumber != string.Empty) { Context.Session["OrderID"] = orderNumber; Context.Session["Amount"] = amount; //Tried Session but did no work //Tried Setting the value in Cookie HttpCookie OrderID = new HttpCookie("OrderID",orderNumber); HttpCookie Amount = new HttpCookie("Amount", amount.ToString()); OrderID.Expires = DateTime.Now.AddHours(3); Amount.Expires = DateTime.Now.AddHours(3); Context.Response.SetCookie(Amount); Context.Response.SetCookie(OrderID); }}\[/code\]//The code to get the values from Cookie \[code\] Service.ServiceAPISoapClient e1 = new Service.ServiceAPISoapClient(); e1.CallEISService("12e", 121); string amount= Request.Cookies["Amount"] != null? Request.Cookies["Amount"].Value:""; \[/code\]
 
Back
Top