Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using IIS 7.5 To host asp.net 4.0 application. the application uses LDAP and Session variables etc.

The application works fine when run in the local dev environment.But not working while hosted in IIS which means the Session variable has code like this

if (Session["groupsList"] != null)
{
groupsList = (ArrayList)Session["groupsList"];
}

which works fine and gets "ADMIN" as value in array list when run in development environment in VS 2010.

But the Session["groupsList"] is null when hosted in IIS 7.5.

Please could you let me know a solution for this as digging into this for 3 days.

Is there a problem with LDAP?Or is that any web.config needs to be changed
Posted
Updated 4-Jul-12 21:39pm
v2

1 solution

which works fine and gets "ADMIN" as value in array list when run in development environment in VS 2010.But the Session["groupsList"] is null when hosted in IIS 7.5.
All what above code does is assign the groupslist if it is found stored in Session. Thats it!

Now, if it is not working on your IIS, above lines mean that the session is null and you should check if the session was even populated at all? Check the place where this is populated and make sure it is happening when needed. Session field will not provide any value until it is filled by you. BTW, since it is session, it will happen on every new user who access your website - per session basis. If this is something common and fixed for everyone, then you should use Application variable and load it up in Global.asax such that it is populated when the application is accessed for the first time.

Lastly, if you are still confused then use remote debugger to tie up with hosted environment and see how steps are happening.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900