Reading cookies
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Reading cookies




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Reading cookies  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-19-07 12:23 PM

Hi,

Is it possible to read a cookie set by a Theme from a JSP component in a WCM
 Viewer portlet? Could anyone give me some sample code?

I think it may not be possible because portal theme and portlets are conside
red to be different web applications. Am I right? Does anyone know it for su
re?

Thank you






[ Post a follow-up to this message ]



    Re: Reading cookies  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-20-07 12:23 AM

Hi,

It should be possible. Cookies are stored/managed by the client and is share
able between different web apps.

I believe the WCM Viewer uses the IBM Portlet API and is not a JSR168 portle
t. As such, in the JSP, you might be able to do:

Cookie[] cookieArray = request.getCookies();

This method is not available in JSR168. While there is not an official stand
ard yet, I found the following trick to work:

String cookieList = request.getProperty("cookie");
/* Now parse through the ; delimited cookie list for the cookie name/value y
ou need */

Also, another alternative might be to use Javascript within your JSP to read
 the coookie.  Hope that help!

Regards,
Bryan
IBM WebSphere Portal
ISV Technical Enablement & Support








[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:27 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register