I have a problem losing the session state in my asp.net application, maybe u can help me.
First of all, I'm using asp.net and js as visual presentation, then I used web services to enable the conection with my database class. When I start the application I store the session (SqlServer mode) usgin the next method:
public static string User{
get{
try{
return (HttpContext.Current.Session != null && HttpContext.Current.Session["User"] == null) ? "" : (string)HttpContext.Current.Session["User"];
}
catch (Exception e){
string white = "";
string msg = e.Message;
return white;
}
}
set{
HttpContext.Current.Session["User"] = value;
}
}
Then, when I need to use the session I make the next call:
string nomUsuario = ses.getUser();
It works perfectly until I try to reach the session since a pop-up window. For example, in my codification I call a new window using js:
$("#states").modal("show");
var transporte = function () {
$('a.viewTransport').live('click', function () {
.....
}
When I debbug my aplication I can see that the result is "HttpContext.Current.Session = null" when I'm inside the pop-up window.
My webconfig:
<sessionState mode="SQLServer" timeout="40" allowCustomSqlDatabase="true" sqlConnectionString="Data Source=localhost\SQLEXPRESS;Integrated Security=SSPI;" cookieless="false" />
Thanks for the Help