Click here to Skip to main content
15,393,066 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created a website in ASP.NET FrameWork 4.0. When I Publish website on Plesk Hosting Panel , Application can't Retain User Session , UserSession null after few seconds.

Here is my WebConfig File

XML
<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
    <system.web>
      
      <sessionState mode="InProc" timeout="30"></sessionState>
      <customErrors mode="Off"></customErrors>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
      <machineKey validationKey="A05BB2B1D91E2DE593F81460D552C2FAA0D1C77CEFEBE65DEE592E2A840DA47DE33B9D3B21FEB558ACBE886091488D7F0E5DA594C8B887C52087291679640E4B" decryptionKey="48A1D4E5DF7109B0DA360DF8787A76B7AB3B6F92F5F0A9AEE19972BE1E1A2036" validation="SHA1" decryption="AES" />

    </system.web>

</configuration>


What I have tried:

I have tried many times for changing in webconfig file but session always null
Posted
Comments
F-ES Sitecore 22-Mar-16 6:29am
   
Contact the hosting company, they may have some restrictions on session use.
kashifjaat 22-Mar-16 6:41am
   
Hosting Company Message: -

There is issue in your web.config file. It is unable to manage your sessions. You need to reconfigure your web.config file correctly.
kashifjaat 22-Mar-16 6:42am
   
For Reference You Can Check Website there is a button on main page -->Click On Button a session will be generate , after after generated its will goes to login page , then refresh page 2 or 3 times session will be null.
www.pinheart.com
kashifjaat 22-Mar-16 6:38am
   
Hosting Company Message: -

There is issue in your web.config file. It is unable to manage your sessions. You need to reconfigure your web.config file correctly.
kashifjaat 22-Mar-16 6:42am
   
protected void Button1_Click(object sender, EventArgs e)
{
Session["UserID"] = "Kashif";
Session.Timeout = 30;
Response.Redirect("login.aspx");
}

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