Session Expired Problem

Discussion in 'ASP.NET / ASP.NET Core' started by salimudheen, Sep 9, 2009.

  1. Hi,

    I had session problem while using Session state mode as "InProc". So I changed the Session State mode to "SqlServer" as per DiscountAsp.Net support team.

    Below is the code I have in web.config file:
    Code:
    <authentication mode= "None" />
    <sessionState mode="SQLServer" allowCustomSqlDatabase = "true" sqlConnectionString="Data Source=XXX;User ID=YYY;Password=ZZZ;Connect Timeout=0" cookieless="false" timeout="30"/>
    Its working. But in few seconds while clicking to any page in navigation secion it gives the following error. In each page i checked the session has the value.

    Server Error in '/' Application.
    -------------------------------------------------------------------------

    Value cannot be null.
    Parameter name: fileOrServerOrConnection
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentNullException: Value cannot be null.
    Parameter name: fileOrServerOrConnection

    Please any one can help me to solve this problem.

    Thanks in advance.

    Salim.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    what line is producing this error? can you post the line?
     
  3. Hmm, there's not much to go on here so I'll try and get my sherlock hat on. fileOrServerOrConnection is a parameter to a DataContext contructor in LINQ to SQL and since this problem is session related I'm starting to suspect that some LINQ to SQL related entity or class has been stuffed into session that although was valid at the time of storing, it sometime shortly after becomes invalidated..

    LINQ to SQL - one of the best tools ever given to software developers for them to shoot themselves in the foot if they're not careful with it..deferred execution, beware.

    It wouldn't be a DataContext that's being stored in session by any chance is it??
     

Share This Page