views:

14

answers:

0

Hi,

I have asp.net app which works fine with visual studio and also local IIS server deployment witout any issue with its session. but after deploying the code to server virtual server (IIS 6, windows 2003) it dosent work properly.

Session gets null in subsequent requests and after few navigations in the site, and this issue is only occures accessing site with IE (ie8)!!! Also it works fine with firefox and safari.

I did all suggestions in this forum: http://forums.asp.net/t/1535794.aspx setting machine key new application pool Setting time out for session I integrate my application with elmah to catch any possible error but there was no logs for that.

And also i changed my code from forms authentication with cookies, to just checking the current loggedin user information wich is stored in session.

EX. Below code is the way i check user role, this is a base class for pages that could be only viewd by users in Super admin, Admin,Supervisor roles. in the codebehind of pages which should only accessable with management roles I drive them from base calss to check if user authorized to view or not.

public class ManagementBP : System.Web.UI.Page
{
    protected override void OnPreInit(System.EventArgs e)
    {
        base.OnPreInit(e);
        var user = (User)Session[AllConstStrs.se_currentUser];
        if (user == null)
            SetErr.NotAuthenticated();//redirects to error page 
        if (user.roleID != "SA" && user.roleID != "A" && user.roleID != "S")
        {
            SetErr.Redirect();//redirect to error page
        }
    }
}

//Manufacturers.aspx.cs
public partial class Manufacturers : ManagementBP
{
     // code ....
}

web config:

<sessionState mode="InProc" timeout="30" cookieless="UseCookies" >

</sessionState>

I deploy the site with visual stodio publish and also i tried with web deployment project (both precompiled and source), I got same results. I get session expiration on virtual server while navigating through website with IE.

I'm not sure is there any setting on IIS that i have to do. Seems that there is issue with coockies that exchanged between server and broswer!!!

I really appreciate any suggetion.