Question

I try do develop a web application with ExtJs 4.0.

On startup the application sends a request to a server. This server sends a response. The responses' header contains Set-Cookie:"connect.sid=foobar"

When I look into the preferences of my browser, I can see that the cookie was created correctly.

My problem is that somehow I cannot access this cookie in my ExtJs application and I don't know why.

I tried to retrieve it with the following methods:

  • document.cookie.split(";")[0]

  • Ext.state.Manager.get("connect.sid"); => of course I initialized the state manager with a cookie provider

  • Ext.util.Cookies.get("connect.sid");

No matter which method I use, I get always undefined as return value

I hope somebody can help me, because I really don't understand why it does not work.

Thanks in advance.

Was it helpful?

Solution

Finally I found the problem.

The httpOnly flag was set in the response header. Therefore the cookie was not accessible for java script.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top