geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Colasurdo <davec...@earthlink.net>
Subject Re: Geronimo and Cookies-code snippet
Date Tue, 03 Oct 2006 20:34:01 GMT
Depending on the urls you are specifying for the test, you may need to 
specify cookie.setPath("/") when creating the cookie.

-Dave-

sreepriya ramakrishnan wrote:
> Geronimo V 1.0 . Is there something else I need to do?
> 
> 
> 
> --- Paul McMahan <paulmcmahan@gmail.com> wrote:
> 
>> When I pasted that code into a JSP (renaming the
>> cookie array to
>> cookies to avoid a compile error) and ran it in the
>> Tomcat version of
>> Geronimo 1.1 it worked as expected.
>>
>> The first request produced:
>> Here testign this...1
>> Here testign JSESSIONID
>>
>> and the subsequent requests produced:
>> Here testign this...2
>> Here testign JSESSIONID
>> Here testign mycookie
>> cookie present..test
>>
>> Which version of Geronimo are you using?
>>
>> Paul
>>
>>
>> On 10/3/06, sreepriya ramakrishnan
>> <sreepriya_ramakrishnan@yahoo.com> wrote:
>>>   Cookie cookie = new Cookie("mycookie","test");
>>>   cookie.setMaxAge(60);
>>>  response.addCookie(cookie);
>>>
>>> then:
>>>
>>> Cookie cookie[]=request.getCookies()
>>> ;System.out.println("Here testign
>>> this..."+cookie.length);
>>>                         for (int
>> i=0;i<cookie.length;i++)
>>>                         {
>>>                                
>> System.out.println("Here testign
>>> "+cookie[i].getName());
>>>                                
>> if(cookie[i].getName().equals("mycookie"))
>>>                                 {
>>>                                        
>> System.out.println("cookie
>>> present.."+cookie[i].getValue());
>>>                                 }
>>>                         }
>>>
>>> -Priya
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> 

Mime
View raw message