I created a custom session class and inherited the SessionStateStoreProviderBase connecting the oracle.
I'm using this how-to, just replace with the connection classes of Oracle.DataAccess.
Until then everything working locally but when I publish on iis 7.5 server with a custom class SessionStateStoreProviderBase is still working, but the variable "session" (HttpSessionStateBase) are zero (null). Ex: Session["idUser"].
Anything I'm forgetting? Please I need help, because the documentation does not seem to be clear about that.
My web.config:
<sessionState timeout="30" mode="Custom" cookieless="false" customProvider="CustomSessionProvider" sessionIDManagerType="namespace.CustomSessionIdManager">
<providers>
<add name="CustomSessionProvider" type="namespace.SessionDataProvider" connectionStringName="connectionOracle" />
</providers>
</sessionState>
<authentication mode="Forms">
<forms loginUrl="~/Login" defaultUrl="~/Inicio" />
</authentication>
Error Log IIS:
#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2014-08-05 01:14:37
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2014-08-05 01:14:37 192.168.xxx.xx GET / - 80 - 10.100.xxx.xx Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/34.0.1847.131+Safari/537.36 302 0 0 6239
2014-08-05 01:14:37 192.168.xxx.xx GET /Inicio - 80 - 10.100.xxx.xx Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/34.0.1847.131+Safari/537.36 500 0 0 374
Exception in the controller:
object reference not set to an instance of an object
Verify before if session is null.
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…