the first time you hit a page url rewriting is enabled because the servlet container has no way to tell whether you support cookies or not (you don't send any cookie header as you still don't have a cookie). See my other reply about what could be the real problem (not url rewriting but a web server that does not know how to interpret rewritten url).
Which servelet container/web server are you using? how are they configured?