现在的jsp/servlet容器一般都支持 cookie和url重写 两种方式进行session维护,但是我现在的需求是:tomcat 服务器,只允许通过 url重写 进行session 维护,不知道该怎么设置?
注:浏览器是允许cookie的,不要求浏览器关闭cookie的情况下使用url重写。谢谢!

解决方案 »

  1.   

    http://tomcat.apache.org/tomcat-5.5-doc/config/context.htmlContext支持cookies参数。设置cookies="false",强制只从url解析sessionid。
    cookies Set to true if you want cookies to be used for session identifier communication if supported by the client (this is the default). Set to false if you want to disable the use of cookies for session identifier communication, and rely only on URL rewriting by the application.