IIS 5 & IIS 6
Session variable weirdness... solve this one anyone?
Last post Apr 18, 2008 09:54 AM by tomkmvp
Apr 17, 2008 05:57 PM|TW77|LINK
Unusual problem here.
The root folder (called WebRoot for this post) contains many folders and pages, including a folder called Common. The application was NOT set to allow session variables, so I enabled that with a 20 minute timeout. The application DOES have a global asa
which persists application level variables. When I enabled the session settings, now pages within the WebRoot folders can share session variables.
Ok, so now I added a folder inside the network (called MyFolder for this post), like this:
Then, I went to IIS, right mouse clicked on the WebRoot icon (the little 'gear' icon) and created a New Virtual Directory, pointed it to MyFolder, etc., and checked to allow it to run ASP scripts. (It added another 'gear' icon, for MyFolder, under the WebRoot
heirarchy.. got it? Both have little 'gear' icons).
Now pages within the MyFolder can share session variables to other pages in the same MyFolder.
Pages within the original WebRoot folders cannot share session variables with pages in the MyFolder from computer A on the network, while computer B on the same network (which is logged in by a different user) CAN share session variables across the folders.
It is almost acting like a 'permission' issue, but I can't figure it out. Note: before everyone suggests the same things, Computer A's browsers ARE configured to accept both cookies and session variables (in fact, we tested with both IE and Firefox, but with
Session variables DO work on computer A. They just won't transfer from pages located in the WebRoot folders to pages in the MyFolder folder. Computer B has no problem.
Ok, all you IIS magicians, solve this one!
Apr 18, 2008 09:54 AM|tomkmvp|LINK
Very strange ... because since you set MyFolder as an application (it shows a gear) its application scope has been partitioned from WebRoot so they should not be able to share session vars at all. So ... what happens with Computer A is the expected behavior
(and this is part of the point of the application setting/scope). Why Computer B behaves the way it does I have no idea ...
(FYI - you should never have set MyFolder as a virtual directory - this setting is for folders that don't physically exist in the webroot path but you'd like to map as part of the web content.)