I think i know what's happening, my login page is index.jsp and my "second page" is default.jsp (yes I know this is bad practice, but I'm just learning JSP for a few days, give me time :) ). So, I tried to do:
if (nome == null) {
out.println("Cookie 'username' nao encontrada");
and with js script..
window.location.reload();
I was redirectedto index.jsp. Thats when I noticed when I do a sucessfull login (and go to default.jsp) my URL is still (for some motive!!) index.jsp.
Looks like its because doing the redirect this way:
<jsp:forward page="/default.jsp" />
<%
Problem solved with response.sendRedirect("default.jsp");
Be advised that request.getParameter("t1") from previous page will not work anymore.
P.S: It's always safer use sessions for authentication.