I've encountered some bizarre behavior in Safari 4. I have a simple link in a web application that I'm working on that calls a Java servlet to log a user out of the site (invalidates the session and sends the user to the login page).
For some reason, Safari will (apparently arbitrarily) decide to cut off the servlet name when sending the request - even though hovering over the tag shows the proper link. This results in the page simply being refreshed instead of logging out. I have alerts in the Java logout servlet to tell me when it's called, and a tcpdump shows that the browser is truncating the link.
Here is the section that's giving me grief:
<div id="controls">
<ul style="margin:2px 10px;padding:0;list-style:none;position:relative;float:right">
<li style="margin-left:1em;position:relative;float:left"><a href="#">Account</a></li>
<li style="margin-left:1em;position:relative;float:left"><a class="admin" href="#" onclick='setGraph("/administration.jsp", null)'>Administration</a></li>
<li style="margin-left:1em;position:relative;float:left"><a href='/flower/visualization/logout'>Logout</a></li>
</ul>
</div>
It's that last <li>
tag that's causing me problems. When rendered, the browser correctly indicates that it will take me to: "http://servername:8080/flower/visualization/logout". Sometimes (not always) when I select it, this is what happens:
#tcpdump -nvvAi 3 port 8080
22:22:08.188397 IP (tos 0x0, ttl 64, id 39137, offset 0, flags [DF], proto TCP (6), length 558)
x.x.x.x:50460 > x.x.x.x:8080: Flags [P.], cksum 0x1e1e (correct), seq 1:507, ack 1, win 65535, options [nop,nop,TS val 91356283 ecr 41426332], length 506
E.....@.@.....%h..%........,...|...........
.q.{.x..GET /flower/visualization/ HTTP/1.1
Host: servername:8080
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://servername:8080/flower/visualization/console.jsp
Accept-Language: en-us
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7
Cookie: JSESSIONID=99bf042df9fdb02df082d5a3b3cf
Connection: keep-alive
Note how the request specifies "/flower/visualization" instead of the correct "/flower/visualization/logout" If I enter the full URL in the browser manually, it works as expected.
Restarting the browser "solves" the problem (the link works for a while). I don't ever see this issue in Chrome or Firefox (I can't try IE because the application requires SVG support). Has anyone else encountered this? Do you know how to fix it? Thanks!