when the session code gets called ????

G

genc ymeri

Hi
I have placed an encounter code in the session_end as well in the
session_start. I'm decreasing the number with 1 everytime a session ends. I
open several IE-s and I closed some of them but the number of sessions only
increase. When really the session_end code get called ? I thought that once
we close the IE, the session go to go, and the session_end gets to get
called !

Thaks in advance,
Genc Ymeri.




protected void Session_End(Object sender, EventArgs e)
{
Application["SessCounts"] = (int) Application["SessCounts"] -1 ;
}

protected void Application_Start(Object sender, EventArgs e)
{
Application["AppCounts"] =0;
Application["SessCounts"] =0;

Application["AppCounts"] = (int) Application["AppCounts"] + 1;


}

protected void Session_Start(Object sender, EventArgs e)
{
Application["SessCounts"] = (int) Application["SessCounts"] + 1;

Response.Write("Number of Apps" + Application["AppCounts"] + "<br>");
Response.Write("Number of Sess" + Application["SessCounts"] + "<br>");

}
 
C

Cowboy \(Gregory A. Beamer\)

Here is a question to ponder: how does the server know that IE closed on the
client?

Answer: It doesn't. Sessions are closed when the session times out, unless a
person logs off. Sessions time out, by default, 20 minutes after the last
hit.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
 
G

genc ymeri

Here is a question to ponder: how does the server know that IE closed on the
client?>>>>>>>>>>>>>

Good point and great approach of answering. I had the wrong impression that
the session has a persistent connection with the webserver so as soon as IE
get closed I assumed that server knows it.

Thanks a lot,
Genc Ymeri.

Cowboy (Gregory A. Beamer) said:
Here is a question to ponder: how does the server know that IE closed on
the client?

Answer: It doesn't. Sessions are closed when the session times out, unless
a person logs off. Sessions time out, by default, 20 minutes after the
last hit.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
genc ymeri said:
Hi
I have placed an encounter code in the session_end as well in the
session_start. I'm decreasing the number with 1 everytime a session
ends. I open several IE-s and I closed some of them but the number of
sessions only increase. When really the session_end code get called ? I
thought that once we close the IE, the session go to go, and the
session_end gets to get called !

Thaks in advance,
Genc Ymeri.




protected void Session_End(Object sender, EventArgs e)
{
Application["SessCounts"] = (int) Application["SessCounts"] -1 ;
}

protected void Application_Start(Object sender, EventArgs e)
{
Application["AppCounts"] =0;
Application["SessCounts"] =0;

Application["AppCounts"] = (int) Application["AppCounts"] + 1;


}

protected void Session_Start(Object sender, EventArgs e)
{
Application["SessCounts"] = (int) Application["SessCounts"] + 1;

Response.Write("Number of Apps" + Application["AppCounts"] + "<br>");
Response.Write("Number of Sess" + Application["SessCounts"] + "<br>");

}
 
C

CMA

Hi,

I hope you need to follow some articles written about asp.net before doing
it. this is related to the asp.net architecture.

this is a simple solution for this.
1) open the file "web.config" in the application root directory.
2) goto the place where display this xml node.
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>

3) set the value of "timeout" to 1. timeout="1"

now the session end will call in 1 minute after close the browser.

hope this helps,
regards,
CMA
 
G

genc ymeri

thanks...


CMA said:
Hi,

I hope you need to follow some articles written about asp.net before doing
it. this is related to the asp.net architecture.

this is a simple solution for this.
1) open the file "web.config" in the application root directory.
2) goto the place where display this xml node.
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>

3) set the value of "timeout" to 1. timeout="1"

now the session end will call in 1 minute after close the browser.

hope this helps,
regards,
CMA



genc ymeri said:
Hi
I have placed an encounter code in the session_end as well in the
session_start. I'm decreasing the number with 1 everytime a session
ends. I
open several IE-s and I closed some of them but the number of sessions only
increase. When really the session_end code get called ? I thought that once
we close the IE, the session go to go, and the session_end gets to get
called !

Thaks in advance,
Genc Ymeri.




protected void Session_End(Object sender, EventArgs e)
{
Application["SessCounts"] = (int) Application["SessCounts"] -1 ;
}

protected void Application_Start(Object sender, EventArgs e)
{
Application["AppCounts"] =0;
Application["SessCounts"] =0;

Application["AppCounts"] = (int) Application["AppCounts"] + 1;


}

protected void Session_Start(Object sender, EventArgs e)
{
Application["SessCounts"] = (int) Application["SessCounts"] + 1;

Response.Write("Number of Apps" + Application["AppCounts"] + "<br>");
Response.Write("Number of Sess" + Application["SessCounts"] + "<br>");

}
 
G

Guest

genc ymeri said:
thanks...


CMA said:
Hi,

I hope you need to follow some articles written about asp.net before doing
it. this is related to the asp.net architecture.

this is a simple solution for this.
1) open the file "web.config" in the application root directory.
2) goto the place where display this xml node.
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>

3) set the value of "timeout" to 1. timeout="1"

now the session end will call in 1 minute after close the browser.

hope this helps,
regards,
CMA



genc ymeri said:
Hi
I have placed an encounter code in the session_end as well in the
session_start. I'm decreasing the number with 1 everytime a session
ends. I
open several IE-s and I closed some of them but the number of sessions only
increase. When really the session_end code get called ? I thought that once
we close the IE, the session go to go, and the session_end gets to get
called !

Thaks in advance,
Genc Ymeri.




protected void Session_End(Object sender, EventArgs e)
{
Application["SessCounts"] = (int) Application["SessCounts"] -1 ;
}

protected void Application_Start(Object sender, EventArgs e)
{
Application["AppCounts"] =0;
Application["SessCounts"] =0;

Application["AppCounts"] = (int) Application["AppCounts"] + 1;


}

protected void Session_Start(Object sender, EventArgs e)
{
Application["SessCounts"] = (int) Application["SessCounts"] + 1;

Response.Write("Number of Apps" + Application["AppCounts"] + "<br>");
Response.Write("Number of Sess" + Application["SessCounts"] + "<br>");

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top