FIXED: ASP Session stopped working across pages

A

Alan

Thought I'd post this in case it's useful to other searchers in the future.

On one of my sites I noticed that session variables had suddenly stopped
persisting across pages. Some things I had done that may have caused this
included installing the .Net framework on my server, and installing VS.Net
EA on my workstation. I had also migrated the server to active directory.

All of a sudden session variables were loosing their values if persisted
across pages (i.e. they still seemed to work on the same page on which the
value was assigned). The site concerned had an underscore in it's name. This
turned out to be the problem.

The problem was fixed by adding another identity to the site with a hostname
does not include an underscore. Open properties for the site in question and
on the Web Site tab click the Advanced... button. Use the same IP address
and Port for the new identity, but add a host header name without an
underscore. Add a new DNS alias record if required.

Make sure you browse the site using this new hostname. I left the old
hostname set up (the one with the underscore) so I didn't have to change
references in Interdev, etc. Fixed it for me.

Someone might like to comment on what the specific cause of this problem is.

Hope this helps,

Alan
 
A

Aaron Bertrand [MVP]

Thanks for that - I must have been caught out by the upgrade to IE6 (with
VS.Net EA I think) or an automatic update. On another note I didn't realise
that underscores weren't legal - I'll have to keep that in mind.

Yes, it's not documented very well (and I think underscores should be
illegal in machine names since they cause this kind of problem).

There is another similar case, using server.mappath. I can legally create a
folder within windows, called "my,folder," but because of the comma, this
will break server.mappath.

A
 
R

Ray at

When you attempt to name an NT5+ machine with an underscore, you are
presented with a large warning about doing so. For some reason, some people
(i.e., my coworkers) choose to ignore this warning and forge ahead...

Ray at work
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top