Hello,
we are having problems displaying non-aspx files (images, style
sheets) since we have upgraded to the 1.1 framework when using a
cookieless session (sessionID in the url).
Check out our file system set up below. Now, in an aspx page, we set
as the "src" of our images something like "../images/animage.jpg". If
the current actual url in the browser is something like http://server/webapp/(someSessionID)/forms/form1.aspx
then the url of the image could be interpreted as something like http://server/webapp/(someSessionID)...es/animage.jpg
(I think). (In the rendered html, of course, the image tag looks
like: <img src="../images/animage.jpg">.)
In the old framework, this way of specifying the image src url (ie.
relative url) with cookieless sessions worked. However, in the new
framework (1.1), it does not work. In testing, though, if we manually
type the following url in the browser, the image is correctly
retrieved: http://server/webapp/(someSessionID)...es/animage.jpg
It seems that ASP/IIS takes the session ID in the url as a real part
of the path.
The above solution (adding another set of "../" if the
Session.IsCookieless=false) to all url's for images, stylesheets,
javascript files, etc is a possible workaround, but we think it's
ugly. (Alternatives would be greatly appreciated.)
So we are stumped. Frankly, we are surprised that more people have
not brought this issue to the newsgroups' attention.
--our set-up---
Virtual Directory : http://server/webapp
located at: c:\inetpub\wwwroot\webapp
and images at: c:\inetpub\wwwroot\webapp\images
aspx forms at: c:\inetpub\wwwroot\webapp\forms
Scott
Jerome 3 3478
Hi Cowboy,
We use your method #2 to link to images (stylesheets, javascript
files, etc). Let me see if I can explain this in a better way.
If we store the session in a cookie, things would look like this:
current page url : http://server/virtual/forms/form1.aspx
which could have an image tag with src="../images/image.gif"
which would mean that the _absolute_ url of the image that the browser
will use to get it is something like: http://server/virtual/forms/../images/image.gif
If we store the session id in the url (cookieless), then things turn
into this:
current page url : http://server/virtual/(1c3ejx25cbrwk...rms/form1.aspx
with an image tag src="../images/image.gif"
which leads to an "absolute" url for the browser of: http://server/virtual/(1c3ejx25cbrwk...ages/image.gif
This is the problem (I think): When we use a relative url for
non-aspx pages, IIS does not give "control" to the aspnet process, so
the session id is not stripped out of the url, which means that IIS
thinks (if it does) that the session id is just another directory of
the url. I do use the "engine" in some other applications, notably
where the images are coming from a db and such, but it would be nice
if i did not have to do the same things for style sheets (etc).
I also think it is strange that we only noticed this problem after
installing the 1.1 Framework.
Thanks,
Scott
"Cowboy (Gregory A. Beamer)" <No************@comcast.netRemuvThis>
wrote in message news:uN****************@TK2MSFTNGP09.phx.gbl... Images do not require session. As such, you would generally ignore
the session with images. In most apps, you drive images in one of three
ways: 1. Direct access http://mysite.com/image.gif 2. Through relative URLs in the page 3. Through an image engine http://mysite.com/image.aspx?id=283490856
When using cookieless sessions, direct access becomes a bit more of
a pain, but .NET can handle it for you ... without the traverse, that is. If
the traverse is necessary, you may need to create an image serving page
(engine) and let it pull the image from the file sys.
-- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA Author: ADO.NET and XML: ASP.NET on the Edge
************************************************** ********************
****** **** Think Outside the Box!
************************************************** ********************
****** **** "Scott" <sc*****@thegapJUNKcompany.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Hello,
we are having problems displaying non-aspx files (images, style sheets) since we have upgraded to the 1.1 framework when using a cookieless session (sessionID in the url).
Check out our file system set up below. Now, in an aspx page, we
set as the "src" of our images something like "../images/animage.jpg".
If the current actual url in the browser is something like http://server/webapp/(someSessionID)/forms/form1.aspx then the url of the image could be interpreted as something like http://server/webapp/(someSessionID)...es/animage.jpg (I think). (In the rendered html, of course, the image tag looks like: <img src="../images/animage.jpg">.)
In the old framework, this way of specifying the image src url
(ie. relative url) with cookieless sessions worked. However, in the
new framework (1.1), it does not work. In testing, though, if we
manually type the following url in the browser, the image is correctly retrieved: http://server/webapp/(someSessionID)...es/animage.jpg It seems that ASP/IIS takes the session ID in the url as a real
part of the path.
The above solution (adding another set of "../" if the Session.IsCookieless=false) to all url's for images, stylesheets, javascript files, etc is a possible workaround, but we think it's ugly. (Alternatives would be greatly appreciated.)
So we are stumped. Frankly, we are surprised that more people
have not brought this issue to the newsgroups' attention.
--our set-up--- Virtual Directory : http://server/webapp located at: c:\inetpub\wwwroot\webapp and images at: c:\inetpub\wwwroot\webapp\images aspx forms at: c:\inetpub\wwwroot\webapp\forms
Scott Jerome
problems displaying images, style sheets using cookieless session
(sessionID in the url) - cookieless session broken images.
Finally... I found the answer! at least in my case.
Hope this helps!
Check your isapi filters in iis. Make sure ASP.net is included and
running. Here's how.
open internet services manager
right clik on the server node and choose properties
master properties <edit>
(tab) isapi flters
look for an entry "ASP.NET_x.xx.x.x.x"
if it is not there, this is your problem!
<add> ASP.Net
C:\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet_ filter.dll
the above value is for 1.0.3705
you should use whichever version you are running.
restart iis
"Scott" <sc*****@thegapJUNKcompany.com> wrote in message news:<#N**************@TK2MSFTNGP10.phx.gbl>... Hello,
we are having problems displaying non-aspx files (images, style sheets) since we have upgraded to the 1.1 framework when using a cookieless session (sessionID in the url).
Check out our file system set up below. Now, in an aspx page, we set as the "src" of our images something like "../images/animage.jpg". If the current actual url in the browser is something like http://server/webapp/(someSessionID)/forms/form1.aspx then the url of the image could be interpreted as something like http://server/webapp/(someSessionID)...es/animage.jpg (I think). (In the rendered html, of course, the image tag looks like: <img src="../images/animage.jpg">.)
In the old framework, this way of specifying the image src url (ie. relative url) with cookieless sessions worked. However, in the new framework (1.1), it does not work. In testing, though, if we manually type the following url in the browser, the image is correctly retrieved: http://server/webapp/(someSessionID)...es/animage.jpg
It seems that ASP/IIS takes the session ID in the url as a real part of the path.
The above solution (adding another set of "../" if the Session.IsCookieless=false) to all url's for images, stylesheets, javascript files, etc is a possible workaround, but we think it's ugly. (Alternatives would be greatly appreciated.)
So we are stumped. Frankly, we are surprised that more people have not brought this issue to the newsgroups' attention.
--our set-up--- Virtual Directory : http://server/webapp located at: c:\inetpub\wwwroot\webapp and images at: c:\inetpub\wwwroot\webapp\images aspx forms at: c:\inetpub\wwwroot\webapp\forms
Scott Jerome
We haven't been able to try it yet to see if this was our problem (IIS
filter was empty though).
Thank you, levous, for your solution. Been looking for something like
this for a long time; thanks.
Scott
"levous" <rz****@yahoo.com> wrote in message
news:81*************************@posting.google.co m... problems displaying images, style sheets using cookieless session (sessionID in the url) - cookieless session broken images.
Finally... I found the answer! at least in my case. Hope this helps! Check your isapi filters in iis. Make sure ASP.net is included and running. Here's how.
open internet services manager right clik on the server node and choose properties master properties <edit> (tab) isapi flters look for an entry "ASP.NET_x.xx.x.x.x" if it is not there, this is your problem!
<add> ASP.Net C:\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet_ filter.dll
the above value is for 1.0.3705 you should use whichever version you are running. restart iis "Scott" <sc*****@thegapJUNKcompany.com> wrote in message
news:<eC**************@TK2MSFTNGP11.phx.gbl>... Hi Cowboy,
We use your method #2 to link to images (stylesheets, javascript files, etc). Let me see if I can explain this in a better way.
If we store the session in a cookie, things would look like this: current page url : http://server/virtual/forms/form1.aspx which could have an image tag with src="../images/image.gif" which would mean that the _absolute_ url of the image that the
browser will use to get it is something like: http://server/virtual/forms/../images/image.gif
If we store the session id in the url (cookieless), then things
turn into this: current page url : http://server/virtual/(1c3ejx25cbrwk...rms/form1.aspx with an image tag src="../images/image.gif" which leads to an "absolute" url for the browser of: http://server/virtual/(1c3ejx25cbrwk...ages/image.gif
This is the problem (I think): When we use a relative url for non-aspx pages, IIS does not give "control" to the aspnet process,
so the session id is not stripped out of the url, which means that
IIS thinks (if it does) that the session id is just another directory
of the url. I do use the "engine" in some other applications,
notably where the images are coming from a db and such, but it would be
nice if i did not have to do the same things for style sheets (etc).
I also think it is strange that we only noticed this problem after installing the 1.1 Framework.
Thanks, Scott
"Cowboy (Gregory A. Beamer)" <No************@comcast.netRemuvThis> wrote in message news:uN****************@TK2MSFTNGP09.phx.gbl... Images do not require session. As such, you would generally
ignore the session with images. In most apps, you drive images in one of
three ways: 1. Direct access http://mysite.com/image.gif 2. Through relative URLs in the page 3. Through an image engine http://mysite.com/image.aspx?id=283490856 When using cookieless sessions, direct access becomes a bit more
of a pain, but .NET can handle it for you ... without the traverse, that
is. If the traverse is necessary, you may need to create an image serving
page (engine) and let it pull the image from the file sys.
-- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA Author: ADO.NET and XML: ASP.NET on the Edge
************************************************** ******************** ****** **** Think Outside the Box!
************************************************** ******************** ****** **** "Scott" <sc*****@thegapJUNKcompany.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... > Hello, > > we are having problems displaying non-aspx files (images,
style > sheets) since we have upgraded to the 1.1 framework when using
a > cookieless session (sessionID in the url). > > Check out our file system set up below. Now, in an aspx page,
we set > as the "src" of our images something like
"../images/animage.jpg". If > the current actual url in the browser is something like > http://server/webapp/(someSessionID)/forms/form1.aspx > then the url of the image could be interpreted as something
like >
http://server/webapp/(someSessionID)...es/animage.jpg > (I think). (In the rendered html, of course, the image tag
looks > like: <img src="../images/animage.jpg">.) > > In the old framework, this way of specifying the image src url (ie. > relative url) with cookieless sessions worked. However, in
the new > framework (1.1), it does not work. In testing, though, if we manually > type the following url in the browser, the image is correctly > retrieved: > http://server/webapp/(someSessionID)...es/animage.jpg > > It seems that ASP/IIS takes the session ID in the url as a
real part > of the path. > > The above solution (adding another set of "../" if the > Session.IsCookieless=false) to all url's for images,
stylesheets, > javascript files, etc is a possible workaround, but we think
it's > ugly. (Alternatives would be greatly appreciated.) > > So we are stumped. Frankly, we are surprised that more people
have > not brought this issue to the newsgroups' attention. > > > --our set-up--- > Virtual Directory : http://server/webapp > located at: c:\inetpub\wwwroot\webapp > and images at: c:\inetpub\wwwroot\webapp\images > aspx forms at: c:\inetpub\wwwroot\webapp\forms > > > Scott > Jerome > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: JV |
last post by:
Hi,
The URL I'm trying to access
http://SERVER/VirtualDir/app/test.aspx
This page has a lot of links and also images and CSS
from the following folder structure.
...
|
by: Anthony Williams |
last post by:
Hi gang,
This one looks like a bug :o(
As you may or may not know, setting session management in web.config to use
cookieless sessions causes the ASP.NET runtime to munge a session ID into...
|
by: Ron Vecchi |
last post by:
I've been searching to find an answer but can not.
I have a site that started out using the defaul session cookieless="false"
Most pages have an IFrame located on them. I decided to change to...
|
by: Daniel Malcolm |
last post by:
Hi
I just wanted to confirm that the "cookieless" attribute of the session
section of the web.config file is an "all or nothing" setting.
For some reason I thought that the following was the...
|
by: vickeybird |
last post by:
Hi,
My current application requires me to use HTTPS and Cookieless
Sessions.
Ive just implemented HHTP Handler to redirect all http request to https
as described by Matt Sollars at...
|
by: Water Cooler v2 |
last post by:
What do you mean by a cookieless session state? When you set the
sessionState section's cookieless attribute to true in the web.config
file, what does that mean?
I read this...
|
by: Mark Olbert |
last post by:
I'm building an ASPNET2 website which uses forms authentication but does not use the Microsoft-supplied membership providers (mostly
because I don't want to create my own provider at this point, and...
|
by: =?Utf-8?B?bWdvcHBlcnQ=?= |
last post by:
I'm having an issue with using web services in a web application marked with
session cookieless attribuet set to "AutoDetect". My real life scenario is
too complex to lay out but here's my...
|
by: Tomasz J |
last post by:
Hello developers,
My custom control allows for specifying paths to images it uses.
In those paths I want to be able to use the "~" app root operator, so my app
works correctly with virtual...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |