asp.net mvc enabling session state
- by Erwin
Hi fellow programmer
I'd like to use session variables in my ASP.NET MVC application.
I already added  tag in my web.config file like this
        <sessionState mode="InProc"
                          stateConnectionString="tcpip=127.0.0.1:2967"
                          sqlConnectionString="data source=127.0.0.1;trusted_connection=true"
                          cookieless="false"
                          timeout="20" />
But I still can't use session variables in my application
I set the var like this in my login method
Session["username"] = userName;
and retrieve it like this
ba.user_id = (string)Session["username"];
I got null string when retrieving.