If I clear the browser cache before I click on the hyperlink, I dont see this issue. But I do not want to delete the cookies, because the business logic used by the filter makes use of the cookies that are set. Also I may not want to delete the cache everytime before I click on the hyperlink :(
I added the below lines in httpd.conf file but still see that the page is cached and hence no server call is made :( LoadModule headers_module modules/mod_headers.so Header set Cache-Control "must-revalidate, no-cache" On Thu, Jun 27, 2013 at 2:25 AM, Sorin Manolache <[email protected]> wrote: > On 2013-06-26 22:22, Sindhi Sindhi wrote: > >> Hi, >> >> I have a C++ Apache filter module for HTML output filtering. I'm seeing a >> certain behavior when using my filter module after setting cookies and >> would want to know if thats expected. >> >> I have a html page index.html, this page has a hyperlink called "Click >> here" and when I click on this link, a second page index2.html should be >> launched. >> >> My filter applies some business logic while filtering html files. >> >> I have a cookie.html file that has Javascript to set a cookie (using >> document.cookie) in the browser. >> >> I need to do the following: >> 1. Enable my filter using LoadModule directive and start the server >> 2. Set a cookie with name=cookieName, value=cookieValue in the browser >> using the cookie.html >> 3. Launch index.html, and then click on "Click here". When this call goes >> to the filter module, I have to apply some business logic before >> index2.html is rendered on browser. >> >> But when I set the cookie in step2 above, I see that the filter module is >> not called because a server call is not made, and the browser opens the >> cached index2.html which does not have my business logic applied. >> >> And, if I dont set the cookie mentioned in step2 above, a server call is >> made when I click on "Click here" link. >> >> How can I ensure that, when I try to launch a html page from a hyperlink, >> the call goes to the filter module even when I set a browser cookie. >> > > What happens if you clear your browser's memory and disk cache before you > click on the hyperlink? > > If it's a cache issue, then use the mod_headers module and the 'Header set > Cache-Control "must-revalidate, no-cache"' directive to disable browser > caching. > > Sorin > > > > > >> My apologies if I'm asking something fundamental, I'm new to how cookies >> work with web-servers, any help would be really appreciated. >> >> Thanks. >> >> >
