February 14, 2020

How to create cookies from server side?

Yes, you read it correctly, you can create cookies in the browser from the server side, and get your browser script to access them. This is enabled via Web Engine HTTP TXN business service.
Siebel Cookies
Siebel Cookies

var oBS = TheApplication().GetService("Web Engine HTTP TXN");

var Inputs = TheApplication().NewPropertySet();
var Outputs = TheApplication().NewPropertySet();

var psCookie = TheApplication().NewPropertySet();
psCookie.SetType("Cookie");
psCookie.SetValue("Value of Cookie");
psCookie.SetProperty "Path", "/";
Inputs.AddChild(psCookie);

oBS.InvokeMethod("SetResponseCookies", Inputs, Outputs);

Keep in mind that this method can be called from any other event in Siebel except application start(Application_Start) event due to product limitation .

Not just that one can use this service to get IP address of the client which is used to access Siebel. I will highly recommend to go through all the methods of Web Engine HTTP TXN business service in your free time.

No comments :

Post a Comment