This week's book giveaway is in the OCAJP forum. We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line! See this thread for details.
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.