cookieless=true, no images are loaded

B

Bernie Raffe

When I change the 'cookieless' flag in the WebConfig file to true,
everything works fine on my local PC, but the images fail to appear when
using the remote server.

I specify my images throughout using a relative directory structure, such as
'images/topbanner.jpg'. I tried changing this to ~/images/topbanner.jpg and
.../images/topbanner.jpg, but this didn't work locally so I didn't even
bother trying it out remotely.

Tthe problem occurs even with static img tags that are hardcoded into the
HTML (as in the above examples)

Can anybody help please?

Thanks,
Bernie
 
B

bruce barker

images are not handled by asp.net by default, so .net cookie munger is not
called. try mapping images to asp.net in your vdir (some performance loss),
or use full paths to the images.

-- bruce (sqlwork.com)
 
B

Bernie Raffe

Hi Bruce,

Thanks for the reply. Forgive me for being thick, but I don't really
understand what your saying!
images are not handled by asp.net by default, so .net cookie munger is not
called.
Then why are the images not appearing? A simple change to the WebConfig to
set cookieless back to false has the immediate effect of displaying all the
images again.
try mapping images to asp.net in your vdir (some performance loss),
You lost me here completely, can you elaborate please.
or use full paths to the images.
This would be a considerable amount of work as most of the images are just
HTML tags, and so they would have to be changed over to ASP:IMAGEs and I
would have to determine the full application path in my code behind for
every image)

This seems a fairly fundamental problem, I don't understan why its not
affecting others to the same degree

Thanks for any further help.

Cheers,
Bernie
 
B

bruce barker

cookieless session work by munging the url with the session id

http://localhost://mysite/sessionid/foo.aspx

when asp.net proccess the request, it strips out the sessionid, and rewrites
the url to

http://localhost://mysite/foo.aspx

with a relative image ref, the browser requests

http://localhost://mysite/sessionid/img.gif

asp.net does not process the request, so iis looks for the folder sessionid
and doesn't find it. in iis you can remap image extensions to be processed
by asp.net, so it will unmunge and rewrite the url. of course this adds .net
processing overhead to the image fetch (url rewrite and asp.net reads and
write the image instead of iis directly)

-- bruce (sqlwork.com)
 
B

Bernie Raffe

Thanks for the detailed description, I get it now.

My site is hosted at an ISP so it may prove difficult getting them to change
the IIS settings to remap image extensions. I just took a look at the web
properties but havn't been able to find where this remapping gets done, do
you happen to know?

Without changing the IIS settings, is there by chance any other way of
specifying the image path, other than by specifying the full absolute path.
As I said originally, i've tried '~/images/img01.jpg' and
'../images/img-1.jpg' but they didn't work locally.

I'd love to know why other's don't appear to be having this problem, i'm
sure they are not specifying absolute paths for their images!!

Cheers,
Bernie
 

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