It sounds like you need to rework your logic. You can *reduce* caching of pages using headers, but browsers are free to (and do) ignore these. See Control of cache and overkill anti-caching CGI headers. The main problem with hyper agressive anti caching is that it is very Back button (read user) unfriendly. On one of the Internet banking sites I use if you try to use back you get a blank can't refresh page. OK so you click *Forward* only to be greeted by the same thing! The >only< way out is back, back back until you get to a cached page - turns out to be the login page. Secure it may be. User friendly it is not.

There are workarounds. Evidently you must be storing a sessionID in a hidden field on the page. If you additionally (or only) used a cookie (also storing the sessionID) you can detect and correct this issue as you will have the current sessionID when the user submits their addition to the cart - this must and always will hit the server. 90%+ of clients will be allowing cookies. Many shopping sites insist on cookies as they allow users a lot more freedom and simplify maintaining state. With session cookies a user could add an item, go to their bank, check their balance, return, add more items to the still current cart and then checkout. You just can't do that with hidden field sessions. You do need to timeout the sessions of course, and only make a new session when required.

cheers

tachyon


In reply to Re: How to force perl script to be refreshed by tachyon
in thread How to force perl script to be refreshed by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.