CGI and browser cahce

  • Thread starter Sascha Möllering
  • Start date
S

Sascha Möllering

Hi,

I've a problem: I don't want the browser to cache websites, because I
wrote a shop with authentification and after having logged out, it is
possible to see the old sites using the back button of the browser. I
tried the following (my header.cgi-file), but it does not work:

print "Content-type: text/html\n\n";
print <<EOF;
<html>
<head>
<META http-equiv="Cache-Control" content="no-cache">
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Expires" content="-1">
<link rel="stylesheet" type="text/css" href="/css/main.css">
</head>
<body>
<table width="78%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="78%" align="left">
EOF


Any ideas?



Thank you,

Sascha
 
G

Gregory Toomey

Sascha Möllering said:
Hi,

I've a problem: I don't want the browser to cache websites, because I
wrote a shop with authentification and after having logged out, it is
possible to see the old sites using the back button of the browser. I
tried the following (my header.cgi-file), but it does not work:

Your Perl question is answered in
http://www.htmlgoodies.com/beyond/nocache.html

gtoomey
 
A

Alan J. Flavell

Your Perl question

I didn't see a Perl question - did you, or was that sarcasm?

I'm not sure whether you're deliberately punishing the questioner by
citing a sub-quality answer to the off-topic question, but as soon as
I saw the page recommending to write syntactically invalid HTML in
order to compensate for bug(s) in a certain browser-like operating
system component, I left.
 
A

Alan J. Flavell

I've a problem:

You have several! I think I'm going to start reading
de.comp.lang.perl.cgi _before_ considering to answer any question seen
here. Has it suddenly become infectious to post the same question
(modulo the language) separately to both, without mentioning the fact?
I am by no means the only person around here who reads German! At
least it was vaguely on-topic there, which it really isn't here.

good luck.
 
J

Jürgen Exner

Sascha said:
I've a problem: I don't want the browser to cache websites, because I
wrote a shop with authentification and after having logged out, it is
possible to see the old sites using the back button of the browser. I
tried the following (my header.cgi-file), but it does not work:

print "[print text snipped]";
print <<EOF; [print text snipped]
EOF

On a first glimpse your Perl code looks fine (well, it's hardly possible to
mess up two simple print statements anyway). You need to provide more
details:
- What do you expect Perl to print
- What does Perl actually print on your computer
Without this information we cannot know why the Perl code does not do what
you expect it to do.

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top