Skip to Content

Servlet call from Portal application to create cookie

Jun 05, 2017 at 09:54 AM


avatar image


we are just trying to use cookie creation in servlet and have this servlet called from portal application.

WE have one portal application testservlet .. which uses URLconnection to connect to the servlet url"dynamiccookie"

if I run the dynamiccookie servlet , its working fine and a cookie is created in browser

however if the same is done using the portal application( using URLconnection to Servlet URL ) : it goes to servlet but the cookie is not seen in browser not we get details in the request object of the cookie.

Please can you let me know what is being missed.

The cookie path is set to / and is secure .

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Jun 06, 2017 at 05:40 AM

Dear Preeti Pradhan,

Why are you creating a servlet "dynamiccookie" and using it through url. This is not required. Create the required cookie in the portal application (abstract portal component application) itself and create an iview for it. Add this iview to AJAX Framework Page. So as soon as user logs in to the portal, this cookie will get created and will be available in header.

Thanks and Regards,


Show 1 Share
10 |10000 characters needed characters left characters exceeded


Let me explain the scenario we want to achieve.. We have to display some critical KM messages as popup on portal. I want to create the cookie in Knowledge management project on button click of a particular message.

the cookie will be specific to particular message and if created on button click means user has read that message and should not be shown on next popup..

For now i was trying to use Portal application to call servlet which will create cookie.