Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session variables behaving weird 1

Status
Not open for further replies.

tvbruwae

Programmer
Aug 9, 2001
224
EU
Hi

Some time ago we moved an ASP website from an IIS4 to an IIS6 server. Most pages seems to work, but pages involving session variables are often giving us problems.

Upon logging in to the site, ASP session variables are set to retain the user's account name (Session("UserID")). When browsing through the different ASP sections we are often redirected to a "not-allowed.asp" page, indicating that we do not have access to the current part of the site. This page contains some styling and the following line:

<%= Request("CurrentPage") %> is not allowed for user <% =session("UserId") %>!

The strange part is that, when we refresh the page showing this message, the position of "session("UserId")" is once filled in, then it's empty, filled in again etc. So there is like 50% chance that the session variable is showing to have data in it, while another 50% chance exists that the variable is empty. This would also explain why we can sometimes access the ASP pages in the website and why we are sometimes redirected to the "not allowed-page" during other attempts. Does anyone have an idea what could be causing this?

Best regards,
Tim
 
you need to check the properties for your virtual directory in IIS manager. Also it might be because of navigating from asp file in one virtual directory to other asp file in another virtual directory.You can avoid this by putting all together in single virtual directory.

-DNG
 
All files are located in the same virtual folder, so that cannot be the source of our problems.. Could you please specify what I need to look for in the IIS properties to troubleshoot?
 
There are several new features in IIS6 which effects how session and application pools are handled.

If you are using the same application pool for several sites, the resources in each application will mix up, and IIS will recycle these sites causing the application and session variables to loose for these sites.

to resolve this, create a new application pool in IIS, and configure the site to use that separate application pool instead.

I assume you will figure out how to create a new pool and configure the site to use that pool :)
 
All files are located in the same folder, and so the URL itself is also not changing.

After applying ali183's additional application pool however, everything seems to be working normally again. I already did some tests with the session variables for quite some time (more than it previously took to raise errors) and still all values seem to be retained. I'll follow this up closely and let you know if the problem returns. But for now it looks a lot better!

Thanks all for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top