Solved

Captcha Image Cache issue in IE

Posted on 2008-10-04
1
802 Views
Last Modified: 2013-12-24
I've read many posts on the web about this issue and have not found a solution that isn't Javascript oriented.

I have a contact form on one of my websites and use a CAPTCHA image for stopping robot spammers.  It works great as long as someone types the matching code.  However, when they submit the form and it doesn't match, my page presents them the form and is creating a new CAPTCHA string which is supposed to appear in the image.  However, in IE, the image is cached in the browser (doesn't do this in FF) and it shows the visitor the same "old" CAPTCHA string because the file is named the same each time.

I could certainly create a variable file name so it loads fresh each time, but then I'd have the overhead scripting of deleting them after a day or so, and if someone was malicious, it would create dozens and dozens on my hard drive.

I prefer my CFC to keep using the same image name each time it creates a CAPTCHA image. However, I need to know how to force the browser to load the newest generated image my script creates.

Again, I want to avoid Javascript but know that a page refresh fixes it when I manually click F5.

0
Comment
Question by:day6
1 Comment
 
LVL 1

Accepted Solution

by:
day6 earned 0 total points
ID: 22644553
I've found a solution that seems to work in IE.

I add a variable string to the image path like

<img src="image.jpg?v=#randomstring#">

This seems to have tricked IE into not caching the same image.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to Eclipse 16 102
PHP Register global 21 64
AWS New EC2 Instance and EBS Storage 2 61
Connect to MS-SQL server from Linux/PHP 8 64
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now