English 中文(简体)
库克群岛病理学并不影响随后的请求
原标题:Path attribute of Cookie is not affecting for subsequent requests

I have a REST web service which sends a cookie in the response. REST URL looks like http://localhost:8080/myfoo/service/v1/acc/login

我在《java法典》中建立了如下 co。

 Response.ok(entity).cookie(new NewCookie("JSESSIONID", "12344", "/", "localhost", null, -1, false));

When I see the response header of the web service, cookie header looks like below

"JSESSIONID=12344;Domain=localhost;Path="/";Version=1"

但是,当我请求采取下述同样领域的其他道路时,

rel=“nofollow>http:// localhost:8080/mybar/service/v1/acc/profile

在请求中不寄送厨师。

因此,当我看望浏览器储存中的 co(使用内容环境)时,我会发现)。 我看到 co子下面的条目。

Name:   JSESSIONID
Content: 12344
Domain: localhost
Path:   /myfoo/service/v1/acc/login
Send for:   Any kind of connection
Accessible to script:   Yes
Created:    Wednesday, July 13, 2016 at 5:04:40 PM
Expires:    When the browsing session ends

因此,如果你注意到,浏览器库中 co鱼的归因与REST的对应服务不同。 这里有什么错误的想法?

问题回答

After a long research I found the root cause. The issue was with cxf library 3.1.6. While converting cookie objects to headers, it quotes special characters. Hence it was quoting / set in java code to "/" in the Set-Cookie header. But browser sees "/" as invalid and sets the path to current path.

But, 3.1.7-SNAPSHOT has fix for this. After I update my cxf library to above said version, the issue is resolved.

如果我们不想更新图书馆,我们就能够人工地把《一套准则》作为替代解决办法。

Here is the reference: https://issues.apache.org/jira/browse/CXF-6862

我也面临同样的问题。 以下是使用案例和细节。

利用喷气式码头图像,我试图在座标(/root/test/testing)如下。

NewCookie cookie = NewCookie ("Name”、“Value”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“”、“

co可以提出同样根本的要求(/root/test/test1,/root/test/test2)。

I want the cookie to be available to all the request in root. Some example request below. /root/user/getdetails /root/work/getworkdetails





相关问题
How to suppress/remove PHP session cookie

I need to suppress an already set session cookie header, but I cannot find any way to do this. Why? I need to make an image, sent by a PHP script, cacheable by the end user; this image is used to ...

Remove Cookies from JS or CSS files

Bizarrely my javascript and css files have cookies (says Firebug). I use Zend Framework and I think it has to do with it. Could I change the .htaccess that CSS or JS files don t link to the ZF or is ...

httplib2, how to set more than one cookie?

As you are probably aware, more often than not, an HTTP server will send more than just a session_id cookie; however, httplib2 handles cookies with a dictionary, like this: response, content = http....

cookies control

what tool wold you recommend me to use in order to see what data are stored in my cookies while i m browsing the net. I m a beginner into webdev field(6 months php experience) and i m curious to see ...

热门标签