Re: [Cppcms-users] The role of cookie path
Brought to you by:
artyom-beilis
From: CN <cn...@fa...> - 2016-07-12 17:31:52
|
On Tue, Jul 12, 2016, at 12:15 PM, augustin wrote: > I don't understand. > Does setting window.location.replace() causes a GET request to be sent to > the > server? Yes. This is the question I asked in SO: http://stackoverflow.com/questions/38245088/open-a-download-window-and-send-cookies-without-navigating-away-from-the-page > Or do you have an AJAX call of some sort in your javascript? window.location.replace() is called after HTML <input> is clicked roughly looks like this: i_am_clicked:function(e){ window.location.replace("/special"); } It is not called from AJAX. > > In any case, you must make sure that the cookies are sent. Server log shows that it does receives the cookie that comes with prefix. That cookie string is exactly the same as that hold by browsers. > My guess is that it's nothing to do with the URL, but with the way the > request > to the server is generated. The request from client in question has one thing different from others - it is initiated by javascript call window.location.replace() or its flavors, while other "valid" requests are initiated by human mouse clicks. > If the browser directly requests http://localhost/special, the cookies > would > be set, won't it? I think that server confirms that too according to this server code: for(auto const &c : request().cookies()) BOOSTER_DEBUG("COOKIES") << c.first << ":" << c.second.path() << "==>" << c.second.value(); Cookie value associated with key "prefix" is written to log. > Just shooting in the dark, in the hope that it may shed some light in the > situation. Best Regards, CN -- http://www.fastmail.com - Same, same, but different... |