Path error when enabling sessionstate cookieless = true

  • Thread starter Thread starter Morten H.
  • Start date Start date
M

Morten H.

Hey,

I have a problem on my server. WHen I activate cookieless sessionstate
I can only execute aspx pages. When the server tries to find an image
in a subfolder eg. http://mysite/(gklffgfgdsg85t6583)/image/top.gif
its not found. The same goes for javascripts ect. if I remove the
sessionid (http://mysite/image/top.gif) the image is found as usual.

This is only a problem on one of our servers, and I suspect that an
update has caused this, but I cant seem to find the error.

Any ideas ?
 
Browser does not know that (gklffgfgdsg85t6583)
is a session id so whenever it sees reference to image/top.gif (or any other
file) it sends a request appending the full path to it.

Only requests for aspx files are mapped to ASP.NET engine and ASP.NET has an
ability to strip out the session id.
Requests for gif, jpg, html, txt,.... are processed by IIS server and IIS
server on WIN2K is totaly unaware of ASP.NET so it can not strip out session
id. I heard that in Win2003 IIS more integrated with ASP.NET and it could
work ( Do not know for sure ).


The solution is to use absolute urls instead of relative urls.

So image/top.gif you shoud be replaced with /image/top.gif (notice first
/ ).

You can use VS to do search and replace in all files ('image' to '/image').

George.
 
George,

That was not the solution to the problem ... sorry.
I found a fix for it at microsoft. It seems that the regkey for my
server was messed up. Running the aspnet_regiis.exe -i solved the
problem. It has nothing to do with the browser. The browser holds the
session id inthe URL. The IIS reads the Session ID from the URL and maps
the files to the correct source, mine didn't but the fix took care of
that.

Hope this helps other people as I had a VERY hard time finding the
solution.



Cheers ! (and Merry Christmas)
 
Back
Top