Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Captcha Image Cache issue in IE

Posted on 2008-10-04
1
Medium Priority
?
816 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

730 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