I have a requirement to identify customers based on browser cookie.. I have to set a cookie with some unique id for the first time the user visits portal and read it when a customer revisits it to understand that the user is not new.
How do i set and read a cookie value in Pega..
Do we have any OOTB way or should i do that using Java.. How do i read the cookie information and set a cookie in pega.
How does pega set the JSESSIONID and Pega-Rules cookie to identify the user logged in.
JsessionID is set by application server, not Pega7. It is used for load balancing / session affinity.
Pega associates browser calls with requestors via the PegaRULES cooke, which is the requestorID.
HTTP headers may only be available to authentication activities - there would be an object pxHTTPServletRequest on the Requestor page which you cast to an HTTPServletRequest then use java methods.
Below find an old code fragment showing access to cookies. There is a property pyHTTPResponseHeaders on pxRequestor page that might be a way to set response headers. Have not done it or researched fully.