www.webdeveloper.com
Results 1 to 12 of 12

Thread: Forcing a browser to not save as a cookie

  1. #1
    Join Date
    Jul 2003
    Posts
    57

    Forcing a browser to not save as a cookie

    Is it possible to tell any browser to not save an image as a cookie?

    The way my new counter works, is that it loads the image from the server, using the same image link, so the computer just loads the image from cookies, which doesn't help becuase the counter doesn't increase (picture wise, technically it does, but you can't see it).

    Thanks!

  2. #2
    Join Date
    Jul 2003
    Posts
    57
    This question was almost off the first page as soon as I posted it since, very strangly, about 13 people posted just after me. With only 10 views so far, most probably mine, I have decided to reply back, to hopefully get some help

  3. #3
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Maybe I wasn't the only one who didn't know what you meant. Images aren't stored in cookies. Maybe you meant your temp directory? Anyway, try this out:

    <meta http-equiv="cache-control" content="no-cache, must-revalidate">
    <meta http-equiv="pragma" content="nocache">

  4. #4
    Join Date
    Jul 2003
    Posts
    57
    Oh, sorry it is the temp folder-

    is there a code just to prevent a certain image from loading? Cause, it would be nice to have all the other images load

  5. #5
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Here's what I would try (not sure if it will work).

    Append a dynamic query string to your image, either using serverside code (best) or javascript. This should (in theory) cause the image to reload everytime. Something like this (but a dynamic query string, of course):

    <img src="yourimage.gif?1032918">

  6. #6
    Join Date
    Jul 2003
    Posts
    57
    Well, thanks for the help, but I couldn't get it to work- problem is, with the counter, it loads a page and not really an image- I mean, sure it loads an image, but I have to link to a page (which isn't an image, so the code didn't quite work)

    whew, if you can understand that, lol

  7. #7
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    And what I'm saying is to use some code like this:

    .php
    PHP Code:
    <?PHP
    $num 
    rand (0,1000000);
    echo 
    "<img src=\"yourimage.gif?$num\">";
    ?>
    Which will dynamically change the query sting every time you load the page (if you also use the no-cache code I gave you)

  8. #8
    Join Date
    Jul 2003
    Posts
    57

  9. #9
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    I don't think I understand what you are asking...

  10. #10
    Join Date
    Jul 2003
    Posts
    57
    Ok, I'll try this :

    I have a counter on my website that links to another website (you know, a free counter)

    Now, I'm having a problem with the counter becuase evertime I view my website, the counter number does not increase.

    On the site that hosts my counter, they say that happens becuase their counters load images to increase the numbers

    But in doing so, the image is saved in your TEMP folder/ cache, whatever, so the counter appears to not be increasing.

    Now, as soon as the image in the TEMP folder is deleted, then the counter will load normally, but then be stored in TEMP again, and go through the same problems.

    So, I was wondering if their was a way to force a browser to not store the link in your TEMP/cache folder-

    The only hard part, which I think is where I might confuse people, is that the link I must put on my website to view the counter, does not link to an image- it links to an actual webpage, so theoretically, I want to force a browser to not store the webpage in your TEMP/cache folder.



    There, I hope that helps, lol

  11. #11
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    As I said earlier, to disable the catching of a page, you will need to use something like this:

    <meta http-equiv="cache-control" content="no-cache, must-revalidate">
    <meta http-equiv="pragma" content="nocache">

  12. #12
    Join Date
    Jul 2003
    Posts
    57
    But, I can't change the code for the page- the page I want to not have loaded is on some other free sever (not mine) so, I can't change the HTML coding

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles