cancel
Showing results for 
Search instead for 
Did you mean: 

WDScopeUtil - Session value clears soon problem

Former Member
0 Kudos

Hi Experts,

We are trying to set some value in session using Webdynpro, but its getting cleared after sometime. We are setting the Value in one WD application and using it in all other WD application.

The method used to put and get is given below.

Is there any other method which can be used so that the session value stays.

Setting the Value using:

WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, "APP_NAME", appvalue1);

Getting the Value from session:

WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, "BP_ID");

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi

The CLIENTSESSION_SCOPE is the most long living among all other WD scope types. It's life time equals to user session life time. Of course if you close the browser, open it again and login with same user the scope will be empty because it'll be a new user session.

If you need something storage living longer then CLIENTSESSION_SCOPE, then use some storage on a server (DB, for example). Or another option is Cookies that is supported only by the last WebDynpro versions.

BR, Siarhei

Former Member
0 Kudos

Hi Mohamed,

Could try the HttpSession method instead of your session method.

This is the set method,

HttpServletRequest request = ((IWebContextAdapter).wDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();

HttpSession session = request.getSession(true);

session.setAttribute("XXX","Test1");

and this one is get method,

String getString = "";

HttpSession session = wdContext.currentSessionElement().getHttpSession();

getString = session.getAttribute("XXX").toString();

Regards,

Prabha

Former Member
0 Kudos

Hi Prabha.. Thanks for your response. with we are using WebDynpro application and what you suggested will work for PDK and note webdynpro. Thats why we went forWDScopeUtil.

Dear All, Please let me know if there is any solution to this problem.