Last post Sep 04, 2018 08:02 AM by dothinhi
Aug 24, 2018 01:12 PM|J47|LINK
I am trying to implement ASP.NET async SQL Session State provider in our application.
We have created a sample application to implement this feature. But we are facing some issues with 'Session.Abandon()'.
In the sample application attached, when we click on 'Login' button, the page will be redirected to 'Default.aspx' page. On 'Default.aspx' page, when we click on 'Session Abandon' button page will be redirected to 'Login.aspx' page.
While clicking on 'Session Abandon' button, 'Session.Abandon()' is fired.
When 'sessionState' mode is set to 'Custom',
On 'Session_Start(object sender, EventArgs e)' event in 'Global.asax' page, the "HttpContext.Current" becomes NULL.
In this case, if we are using 'Session.Clear()' instead of 'Session.Abandon()' its working fine.
Could you please provide the reason for why "HttpContext.Current" becomes NULL when 'Session.Abandon()' is used. Also please provide a solution to overcome this issue?
When 'sessionState' mode is set to 'SQLServer',
"HttpContext.Current" is not null.
Please find the sample application from the following link
Can anyone suggest a solution for this?
Thanks in advance.
Aug 27, 2018 10:09 AM|Brando ZWZ|LINK
According to application I have run the application you have provided.
If I set the session state to custom, it shows the "Parser Error Message: Provider must implement the class 'System.Web.SessionState.SessionStateStoreProviderBase'". error.
If I used the SQLServer mode, it works well.
Httpcontext is not null.
Could you please show more details about how you implement the SessionStateStoreProviderBase class?
If you could provide more details information, it will be more easily for us to find the reason and find the solution.
Aug 27, 2018 01:50 PM|J47|LINK
Thanks for your response.
Navigate to the web project. Click -> 'F4' button. Then change 'Managed Pipeline mode' to 'Integrated'.
Or please check the application from following link.
Let me know if it works.
Sep 04, 2018 08:02 AM|dothinhi|LINK
thanks for your answer