473,473 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

cache problemette

Nel
Hi!

I am trying to prevent a browser going back to a logon screen and any user
being able to refresh (and the browser re-submits the post data).

I understand that the following should work. It doesn't.

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Mon,26 Jul 1997 05:00:00 GMT");

Any ideas. And yes I am inserting the code before any output.

Thanx

Nel.

--
DISCLAIMER: There is an extremely small but nonzero chance that,
through a process known as "Tunneling", this e-mail may spontaneously
disappear from its present location and reappear at any random place in the
Universe, including your neighbour's domicile. The sender will not be
responsible for any damages or inconvenience that may result.
Jul 17 '05 #1
3 1530
Nel wrote:
Hi!

I am trying to prevent a browser going back to a logon screen and any user
being able to refresh (and the browser re-submits the post data).

I understand that the following should work. It doesn't.

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Mon,26 Jul 1997 05:00:00 GMT");

Any ideas. And yes I am inserting the code before any output.

Thanx

Nel.


There isn't a way to prevent your form from being submitted by the
browser (it's a browser behaviour, it can do whatever it wants). One
thing you can do is set a session cookie, or a session variable
(session_start() adds the headers you've mentioned anyway) once a user
has already submitted the form, a variable is set so the next time it's
submitted it doesn't get processed again.

Those headers you've mentioned means that a browser MUST post data to go
back and view the page (which causes a dialog prompt or a "page expired"
message). Session cookies are the only way I found to get around that,
and still carry data from one page to another without using get/post and
forcing the browser to re-post it's data.

Hope this helps..
Jul 17 '05 #2
"Nel" <ne***@ne14.co.NOSPAMuk> wrote in message
news:40*********************@ptn-nntp-reader03.plus.net...
Hi!

I am trying to prevent a browser going back to a logon screen and any user
being able to refresh (and the browser re-submits the post data).

I understand that the following should work. It doesn't.

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Mon,26 Jul 1997 05:00:00 GMT");

Any ideas. And yes I am inserting the code before any output.

Thanx

Nel.


I usually do a redirect after every post in order to prevent that nasty
resubmission message. Works well in IE. Just do header("Location:
index.php") or something similiar.
Jul 17 '05 #3
Nel
"Chung Leong" <ch***********@hotmail.com> wrote in message
news:if********************@comcast.com...

I usually do a redirect after every post in order to prevent that nasty
resubmission message. Works well in IE. Just do header("Location:
index.php") or something similiar.


Thanks Chung! That is so simple and works very well in IE and Netscape.

Nel
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
5
by: Darrel | last post by:
I thought this warranted a new thread. Yesterday I asked about access relatively static content...is it better to read from the DB, or just grab a text file. It was suggested that I use the DB...
14
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't...
1
by: William Sullivan | last post by:
I'm trying to nail down some issues with the cache in my application. Currently, I have an object that stands between my business logic and database logic called CacheLogic (cute, no?). ...
13
by: Andrew Morton | last post by:
I am caching some data in VB.NET using System.Web.Caching, is it possible to lock the cache so that other sessions attempting to access the same cache wait when it is being updated? I have the...
26
by: Ed L. | last post by:
Here's some of my current notions on pgsql performance tuning strictly as it relates to pgsql tuning parameters in the context of a dedicated linux or hpux server. I'm particularly focusing on...
0
by: mateipuiu | last post by:
When a try to run a client build on 2005, which uses the Microsoft.ApplicationBlocks.Cache.dll reference, when using a Microsoft.ApplicationBlocks.Cache.dll created on Debug mode, the client works...
5
by: Stan SR | last post by:
Hi, Some newbie questions.. :-) First, what is the namespace to use for the Cache class ? When I use this bit of code I get an error if (Cache==null) Cache.Insert("myUserList",userlist);...
0
by: =?Utf-8?B?YmlqYXk=?= | last post by:
The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception. We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.