By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

when the session code gets called ????

P: n/a
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>");

}
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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" <ge********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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>");

}

Nov 19 '05 #2

P: n/a
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)" <No************@comcast.netNoSpamM> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
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" <ge********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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>");

}


Nov 19 '05 #3

P: n/a
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

"genc ymeri" <ge********@hotmail.com> wrote in message
news:#8**************@TK2MSFTNGP12.phx.gbl...
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>");

}

Nov 19 '05 #4

P: n/a
thanks...
"CMA" <cm**************@textcentric.lk> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
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" <ge********@hotmail.com> wrote in message
news:#8**************@TK2MSFTNGP12.phx.gbl...
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>");

}


Nov 19 '05 #5

P: n/a


"genc ymeri" wrote:
thanks...
"CMA" <cm**************@textcentric.lk> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
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" <ge********@hotmail.com> wrote in message
news:#8**************@TK2MSFTNGP12.phx.gbl...
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>");

}



Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.