Question

2
Replies
1318
Views
KunalB63 Member since 2015 1 post
Marsh
Posted: 2 years ago
Last activity: 2 years 7 months ago
Closed

How to get the HTTP Response object inside the authentication activity?

Hi,

I am facing an issue where I need to access the HTTP Response object where I need to add a new custom cookie to be stored on the session.

I tried to access to Response object using the code below like we do for accessing the request header:

javax.servlet.http.HttpServletResponse res = (javax.servlet.http.HttpServletResponse)tools.getRequestor().getRequestorPage().getObject("pxHTTPServletResponse");

But the property pxHTTPServletResponse is not a standard PEGA property which holds the response headers so this is having null value in the object.

So I am getting null pointer exception when I am executing the below code:

res.addCookie(cookiename);

So can anyone please tell me how to access the Response Headers in PEGA and add the cookie to it? [Just an information this is not from any service calls]

Security
Moderation Team has archived post
Share this page LinkedIn