tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Bainbridge <ja...@jblinux.org>
Subject Re: cookies problem...going crazy
Date Sun, 25 May 2003 21:56:42 GMT
On Mon, 26 May 2003 05:29, klas Järgenstedt wrote:
> Cookie cookies[] = request.getCookies();  
>     for(int i=0;i<cookies.length;i++){

Try changing it to something like the below, your declaration for your cookies 
array is wrong and it could be getting confused by the name you gave it:

// Check for cookies
Cookie[] cookie_jar = request.getCookies();

// Check to see if any cookies exists
if (cookie_jar != null)
{
        for (int i =0; i< cookies.length; i++)
        {
                Cookie aCookie = cookie_jar[i];
                pout.println ("Name : " + aCookie.getName());
                pout.println ("Value: " + aCookie.getValue());
        }
}

Regards,
-- 
Jason Bainbridge
KDE Web Team - http://kde.org 
webmaster@kde.org 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message