cancel
Showing results for 
Search instead for 
Did you mean: 

Set Cookie in ASP & Read in WebDynpro

Former Member
0 Kudos

Hi All,

I have button "Signature" in Webdynpro screen, when click that button i am calling URL iview (..\Simple.aspx ) & it opens and show in new window. Now i wanted to set cookie in ASPx file and read the same in Webdynpro screen. In the Webdynpro I am not able to read the cookie which was set in aspx file. In the aspx file I am able to see 4 portal cookies when call alert(document.cookie );. I am able to read 4 portal cookies even in the webdynpros but not my custom cookies ( by aspx file )

Here is my Code:

Java script code in ASPX file:

function setCookie()

{ window.document.cookie= "SIGN2=RAMANA";

alert(document.cookie);

}

<input type=button value="Set Cookie" onClick="setCookie()">

Code in WebDynpro:

//HttpServletRequest req =((com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();

Cookie[] cookies = TaskBinder.getCurrentTask().getWebContextAdapter().getHttpServletRequest().getCookies();

IWDMessageManager msgmgr = wdComponentAPI.getMessageManager();

int len = cookies.length;

for ( int j =0 ; j<len; j++)

msgmgr.reportSuccess(cookies[j].getName() + ":" +cookies[j].getValue());

I appreciate your help.

Thanks,

Ramana.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your quick response.

Could You please give me an idea how we can do eventing if applications are running two different windows. I think eveting only works if both iviews are in the same page. Now here iviews are in the same session not in the same page. Please give me a hint how I can write EPCM eveting code in asp file if the eventing works between these screens.

Regards,

Ramana.

Former Member
0 Kudos