I'm creating a site and needs some help. Below is my authentication tag and session tag in web.config
Now in login page after firsttime login i set some session data... like
Now say i close the browser... and next time when i open the site it takes me directly to the default page [Login_LoggedIn is not called accordingly]... because i'm already logged in for 30 mins acc. to configuration.
but as my session id gets changed i can't access Session["EMPLOYEELOGGED IN"] from any page in this time. It always returns null.
But how do i get back the previous session for that person?
Code:
<authentication mode="Forms"> <forms protection="All" loginUrl="Pages/Log In/Login.aspx" name=".ASPXFORMSAUTH" cookieless="UseCookies" requireSSL="false" defaultUrl="Pages/Common/Default.aspx" enableCrossAppRedirects="false" slidingExpiration="true" timeout="30" path="/"> </forms> </authentication> <sessionState mode="InProc" timeout="30" cookieless="false" cookieName=".ASPSession"/> And I have a custom Membership Providor.... <membership defaultProvider="SqlMemberShipProvider" userIsOnlineTimeWindow="15" hashAlgorithmType=""> <providers> <clear/> <add name="SqlMemberShipProvider" type="RoalManagement.SqlMemberShipProvider" connectionStringName="SqlServices" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="true" writeExceptionsToEventLog="true" applicationName="OnlineOnTheWeb" minRequiredPasswordLength="6" passwordStrengthRegularExpression="^.*(?=.{6,50})(?=.*[a-z])(?=.*[A-Z])(?=.*[\d\W]).*$" maxInvalidPasswordAttempts="3" requiresUniqueEmail="true" /> </providers> </membership>
Code:
protected void Login_LoggedIn(object sender, EventArgs e) { //..... Session["EMPLOYEELOGGEDIN"] = "Y"; //..... }
but as my session id gets changed i can't access Session["EMPLOYEELOGGED IN"] from any page in this time. It always returns null.
But how do i get back the previous session for that person?
Comment