chris,

useful info. however when i print the current thread stack trace with a
HttpSessionListener
i see few info; something like this

Ljava.lang.STackTraceElement;@4313455

i´m using something like
System.out.println(Thread.currentThread().getStackTrace());

in the sessionCreated().

any advice?

thanks

Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Banto,
> 
> On 5/22/2010 12:01 PM, banto wrote:
>> 
>> Hi Chuck,
>> 
>> i have found out who is generating that in my code:
>> 
>> dispatcher.forward(request, response);
>> 
>> the response contains also the set cookie header...it is automatically
>> done
>> by tomcat...
> 
> You can "safely" call RequestDispatcher.forward() without sending a
> Set-Cookie header. The code to your doPost method might be helpful,
> here. If you do any of the following, Tomcat will create a session for
> you and send a Set-Cookie header for the session:
> 
> 1. directly call request.getSession() or request.getSession(true)
> 
> 2. forward-to or include a JSP that does not have session="false"
>    declared in the <%@ page %> directive
> 
> If you want to know what code it creating the session, write an
> HttpSessionListener, configure it in web.xml, and have your
> sessionCreated() method print the stack trace of the current thread.
> 
> Hope that helps,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkv6jkAACgkQ9CaO5/Lv0PCvngCggPq3JYga/w4O0yy8/1Vnua5t
> /QEAnjS1/bSZ87u1ie6aO2omXuWkzCim
> =Bf+a
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/set-cookie-tp28639362p28661057.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to