tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hernâni Henrique Ramos Cerqueira <>
Subject Re: Open a session based on the session id
Date Fri, 24 Aug 2007 15:29:53 GMT
Thanks, I always tough that with ajax requests cookies were not sended.
This is my first application that mixes ajax requests and session
tracking, and becaus I was not able to read session info, I immediately
assumed that (and i think i had read that somewhere). But the problem
was with the info... My bad, but thanks anyway.


Sex, 2007-08-24 às 10:39 -0400, Christopher Schultz escreveu:
> Hash: SHA1
> Hernâni,
> > I'm developing a webapp that does lots of ajax requests, but I need to
> > keep track of the session. What I do is to read the JSESSIONID cookie
> > with javascript and send the value as a POST parameter when I make the
> > request, but then tomcat doesn't open the session automaticaly.
> That's because Tomcat doesn't read POST parameters to look for a session
> id. You need to encode the session id in the URL if you are not sure
> that your browser will send a cookie.
> Try something like this:
> var sessionId = .... ; read cookie
> var URL = "http://...../foo/bar.baz;" + sessionId + "?param=value&amp;"
> Note that this is all very silly, since you're using javascript to sniff
> the sessionid from a cookie. If you already have a cookie, then the
> browser /is/ using cookies, and you don't need to do any of this since
> the browser will send the cookie to the server automatically.
> - -chris
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla -
> iD8DBQFGzu2t9CaO5/Lv0PARAvURAJ9RXeteg31i2VconN67NaChphXtWgCgw207
> FwfauFTn+WvmJ9m/Aea/tmQ=
> =L5Bf
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message