Reputation: 4468
While working on a web application with struts, I came across the following situation.
Consider the following to links:
<s:a href="action1.action" id="link1" ></s:a>
and <s:a href="#" id="link2" onclick="submitData();"></s:a>
the function submitData()
is defined as follows:
function submitData(){
var var1="x"
$("#targetDiv").load("action1.action",{someVar:var1 });
}
What I discovered when hitting the links is that the number of cookies sent to the action is different. What can cause that difference?
Upvotes: 0
Views: 36
Reputation: 392
As per cookies definition, some some of them could be set to work in different URL paths:
The cookie domain and path define the scope of the cookie—they tell the browser that cookies should only be sent back to the server for the given domain and path. If not specified, they default to the domain and path of the object that was requested...
Wikipedia Article about cookies
Upvotes: 1