Re: Help Please WebDNA 6 Secure Forms Problem
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 57917
interpreted = N
texte = Colin Sidwell wrote:I have to assume that you are talking about users pressing the Back button and not being able to see the prior page. If not, please describe exactly the sequence of events (better yet, put a test page on a public site and post the URL).In any case:Version 6.x> Server: Apache/2.0.49 (Unix) DAV/2 PHP/4.3.6 mod_ssl/2.0.49 OpenSSL/0.9.6iVersion 5.x> Server: Apache/2.0.47 (iTools 7/Mac OS X) DAV/2 PHP/4.3.2 mod_ssl/2.0.47 OpenSSL/0.9.6iYou are running under different operating systems, Apache, and WebDNA, so it is not going to be obvious which is doing what.> If we change the form to a plain .htm document (not parsed by WebDNA) the> form works on version 6 and there are no Cache-control or Pragma values in> the header.That is because .htm pages are static and pages processed by WebDNA are generated. In general (and for good reason), dynamically generated pages should _never_ be cached. You can override that, but only by setting the /proper/ HTTP headers.The correct way to handle this is to set the Date, Last-modified, and Expires headers. The Cache-control and Pragma values are suggestions only; even if you got them set correctly some proxy servers will ignore them (like AOL's). I've included my solution after my signature. You may have to adjust the paths for your setup (I keep global includes in ^Includes so I can access them from any site).Put the following in your common header include file:[include file=^Includes/MIMEHeaders.inc&expires=60]to have the page expire in 60 minutes (for example). You'll also need to adjust the GMT offset as specified in the GMTDate.inc file.HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4501 Forbes BoulevardSuite HLanham, MD 20706301-459-3366 x.5010fax 301-429-5748============cut here ================[!] ------- MIMEHeaders.inc -------[/!][if "[expires]"="[raw][expires][/raw]"][!] ---- Check for input variable[/!][then][!][/!][math show=f]expires=0[/math][/then][!][/!][/if][!][/!][SETMIMEHEADER name=Date&value=[include file=^Includes/GMTdate.inc]][SETMIMEHEADER name=Last-modified&value=[include file=^Includes/GMTdate.inc]][SETMIMEHEADER name=Expires&value=[include file=^Includes/GMTdate.inc&offset=[expires]]]============cut here ================[!] ------- GMTdate.inc -------Takes optional parameter offset in minutes and returns current date/time in GMT long formatReplace the {5:00:00} with your non-DST offset from GMT[/!][math time&show=f]GMT={[date %X]}+{5:00:00}[showif [date format=%Z]^Daylight]-{1:00:00}[/showif][/math][!][/!][math time&show=f]NOW={[date %X]}[/math][!][/!][if "[offset]"="[raw][offset][/raw]"][!][/!][then][!][/!][math show=f]offsettime=0[/math][/then][!][/!][else][!][/!][math show=f]offsettime=[offset]*60[/math][/else][!][/!][/if][!]--- Create the GMTexpires variable[/!][math time&show=f]GMTexpires=[GMT]+[offsettime][/math][!]--- Create the MIMEexpires string[/!][text show=t]MIMEexpires=[!][/!][if ([GMT]>[NOW]) and ([GMTexpires]>[GMT]) and ([GMTexpires]<86400)][!] ---- all in the same day ----[/!][then][!][/!][date format=%a, %d %b %Y][!][/!][/then][!] ---- at least one day later ----[/!][else][!][/!][format days_to_date %a, %d %b %Y][math]{[date]}+{00/[!][/!][showif [GMTexpires]>86400][math]floor([GMTexpires]/86400)[/math][/showif][!][/!][showif [GMTexpires]<86401]01[/showif][!][/!]/0000}[/math][/format][!][/!][/else][!][/!][/if][!][/!] [Format Seconds_To_Time][GMTexpires][/Format][!][/!] GMT[/text]============cut here ================-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Colin Sidwell wrote:I have to assume that you are talking about users pressing the Back button and not being able to see the prior page. If not, please describe exactly the sequence of events (better yet, put a test page on a public site and post the URL).In any case:Version 6.x> Server: Apache/2.0.49 (Unix) DAV/2 PHP/4.3.6 mod_ssl/2.0.49 OpenSSL/0.9.6iVersion 5.x> Server: Apache/2.0.47 (iTools 7/Mac OS X) DAV/2 PHP/4.3.2 mod_ssl/2.0.47 OpenSSL/0.9.6iYou are running under different operating systems, Apache, and WebDNA, so it is not going to be obvious which is doing what.> If we change the form to a plain .htm document (not parsed by WebDNA) the> form works on version 6 and there are no Cache-control or Pragma values in> the header.That is because .htm pages are static and pages processed by WebDNA are generated. In general (and for good reason), dynamically generated pages should _never_ be cached. You can override that, but only by setting the /proper/ HTTP headers.The correct way to handle this is to set the Date, Last-modified, and Expires headers. The Cache-control and Pragma values are suggestions only; even if you got them set correctly some proxy servers will ignore them (like AOL's). I've included my solution after my signature. You may have to adjust the paths for your setup (I keep global includes in ^Includes so I can access them from any site).Put the following in your common header include file:[include file=^Includes/MIMEHeaders.inc&expires=60]to have the page expire in 60 minutes (for example). You'll also need to adjust the GMT offset as specified in the GMTDate.inc file.HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4501 Forbes BoulevardSuite HLanham, MD 20706301-459-3366 x.5010fax 301-429-5748============cut here ================[!] ------- MIMEHeaders.inc -------[/!][if "[expires]"="[raw][expires][/raw]"][!] ---- Check for input variable[/!][then][!][/!][math show=f]expires=0[/math][/then][!][/!][/if][!][/!][SETMIMEHEADER name=Date&value=[include file=^Includes/GMTdate.inc]][SETMIMEHEADER name=Last-modified&value=[include file=^Includes/GMTdate.inc]][SETMIMEHEADER name=Expires&value=[include file=^Includes/GMTdate.inc&offset=[expires]]]============cut here ================[!] ------- GMTdate.inc -------Takes optional parameter offset in minutes and returns current date/time in GMT long formatReplace the {5:00:00} with your non-DST offset from GMT[/!][math time&show=f]GMT={[date %X]}+{5:00:00}[showif [date format=%Z]^Daylight]-{1:00:00}[/showif][/math][!][/!][math time&show=f]NOW={[date %X]}[/math][!][/!][if "[offset]"="[raw][offset][/raw]"][!][/!][then][!][/!][math show=f]offsettime=0[/math][/then][!][/!][else][!][/!][math show=f]offsettime=[offset]*60[/math][/else][!][/!][/if][!]--- Create the GMTexpires variable[/!][math time&show=f]GMTexpires=[GMT]+[offsettime][/math][!]--- Create the MIMEexpires string[/!][text show=t]MIMEexpires=[!][/!][if ([GMT]>[NOW]) and ([GMTexpires]>[GMT]) and ([GMTexpires]<86400)][!] ---- all in the same day ----[/!][then][!][/!][date format=%a, %d %b %Y][!][/!][/then][!] ---- at least one day later ----[/!][else][!][/!][format days_to_date %a, %d %b %Y][math]{[date]}+{00/[!][/!][showif [GMTexpires]>86400][math]floor([GMTexpires]/86400)[/math][/showif][!][/!][showif [GMTexpires]<86401]01[/showif][!][/!]/0000}[/math][/format][!][/!][/else][!][/!][/if][!][/!] [Format Seconds_To_Time][GMTexpires][/Format][!][/!] GMT[/text]============cut here ================-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
John Peacock
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Quit revisited (1997)
Error:Too many nested [xxx] contexts (1997)
Date to days (2002)
[WAY OFF TOPIC] anybody live in Kansas? (2003)
WebCat2 - Getting to the browser's username/password data (1997)
Overwiting SKU in Cart (2002)
can WC render sites out? (1997)
[taxRate] [TaxTotal] ? (1997)
[WebDNA] v7 Stress Test and Strange Behaviour (2012)
PCS Frames (1997)
WebCat2: multiple currency support (1997)
Check boxes (1997)
Use of Back and Reload Buttons on ShoppingCart page? (1997)
[WebDNA] Error 500 with SUMM=T (2017)
OK, here goes... (1997)
WebCat2b13MacPlugIn - [shownext method=post] ??? (1997)
WCS Newbie question (1997)
WebCat2.0 [format thousands .0f] no go (1997)
[WebDNA] Anyone used these people ? (2010)
WebCatalog Install Problem (2005)