Welcome to WebmasterWorld Guest from 126.96.36.199
Forum Moderators: ocean10000
My question is instead of creating a cookie for every image can I use a variable in the cookies.
I know this does not work but if there is something like this available it would be very helpful to me.
For Example: response.cookies("sitename")(ImageVariable) = 1
Response.Cookies("site1")("image1") = " ../image1.jpg"
Response.Cookies("site1")("image2") = " ../image2.jpg"
... so you should be able to do this:
sSubKeyname = "image1"
Response.Cookies("site1")(sSubKeyname) = " ../image1.jpg"
<do more stuff>
sSubKeyname = "image2"
Response.Cookies("site1")(sSubKeyname) = "../image2.jpg"
warning, I haven't tried this code, but it should work
This leaves a single cookie named site1. Not too many subkeys....There are limits as to how much you can stuff in a cookie, plus it can slow the roundtrip time for the user. With each click they are generating more 'weight' in the Request.
Can the session state store any of this or are you looking to persist the data beyond a single session?
You only have 4KB of cookie space to work with, so if a user goes and rates a whole bunch of photos, you could run against that size limit if you're storing each photoId or whatever.