Hi,

What cookies.txt are you speaking about?

If you-re talking about browser's cookies should remember that
they are tied to specific server name(s) or domains, and sometimes also an
url prefix within these servers.

So browsers send cookies only when the request's url matches the ones
set before, and stored within cookies.txt...
(eg a cookie set for *.netscape.com wont be sent to your servlet,
unless it runs on some of netscape's server)

Cezar.

On Fri, 16 Apr 1999, Hector Fabio Meza Martinez wrote:

> Hi.
> I'm trying to implement a servlet that gets cookies from the client, the
> following is the code i'm using:
>
>         Cookie[] cookies = req.getCookies();
>                 if (cookies != null)
>                 {
>
>       for(int i=0; i<cookies.length; i++)
>       {
>         String n = cookies[i].getName(),
>          d = cookies[i].getDomain();
>          if(n != null &&  d != null )
>          {
>                 out.println(n);
>                 out.println(d);
>          }
>       }
>
> So far, i'm just trying to print them back to the user. The problem is that
> getCookies is returning null, but the cookies.txt file has text, so there
> should be cookies. Is there any mistake with the code? or maybe the problem
> is because i'm testing the servlet with servletrunner?
>
> Any help would be appreciated
>
> Hector
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>


Cezar Totth                             email:  [EMAIL PROTECTED]
                                        Fax:    (401) 220 33 95
Genesys Software Romania                Phone:  (401) 638 49 44
Stefan Furtuna 169, sect.6
cod 77171, Bucharest
Romania

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to