473,379 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Cookieless session problems

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
Nov 17 '05 #1
3 3513
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


Nov 17 '05 #2
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

Nov 17 '05 #3
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
>
>

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
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. ...
10
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...
7
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...
2
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...
0
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...
2
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...
1
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...
3
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.