You must set cookie before start output to browser.
Because cookie sets in header and if you started output to browser then at
this point header has been send to browser and you can not change it.

It works sometimes because of bufferezation. So even if you started to
output to browser it's been buffered and you can set cookie.

George.

> -----Original Message-----
> From: Baris EFE [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, December 28, 1999 6:17 AM
> To:   [EMAIL PROTECTED]
> Subject:      response.addCookie()
>
> i wrote a servlet that there are more than 250 item on an select field
> like:
>
> out.write("<option value='YUNSA'>YÜNSA</option>");
>
> After a special time of option value
> response.addCookie(key, value) doesn't work.
>
> But if i limit the option amount like 100-120
> response.addCookie(key, value)  works.
>
> It sounds doesn't logical to me but when i try it several times i
> encounter
> with such a problem!!
> Is there anybody to explain that or solution?
> Thanks!!
>
> __________________________________________________________________________
> _
> 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

___________________________________________________________________________
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