tushar panda wrote:the servlet shown below requires a refresh to show cookies values.
............
but i want it to auto refresh which is not possible because it user doPost method .
I'm not sure I get your problem, but how are you invoking the servlet ?
Cookies are a client-side concept. The servlet does not create the cookie, it merely creates headers that tell the browser to create the cookie. Until the headers have been seen by the browser, the cookie does not exist.