Session_Start triggered for each requested aspx page

  • Thread starter Gabriel Lozano-Morán
  • Start date
G

Gabriel Lozano-Morán

Is there any particular reason why the Session_Start() event gets triggerend
by each aspx page request?

Details:
Windows XP Pro SP2
..NET Framework v1.1.4322
C#
SessionState set to mode InProc in web.config
Session timeout set to 20 minutes

My Session_Start():
protected void Session_Start(Object sender, EventArgs e)
{
Session["LanguageId"] =
ConfigurationSettings.AppSettings["DefaultLanguageId"];
Session["Culture"] =
ConfigurationSettings.AppSettings["DefaultCulture"];
}

I have a frameset containing a banner frame - contents frame and a main
frame. I have set a breakpoint on the first line in my Session_Start.

When I start the application, the Session_Start gets triggerend once. For
each consequent requested aspx page loaded in the main frame by clicking on
a link in the contents frame will create for some reason a new session.
Nothing specials happens in these pages that might cause this behaviour.

Any help or leads in the right direction are stronly appreciated.

Gabriel Lozano-Morán
 
G

Gabriel Lozano-Morán

Hello Marina

Following your lead that it had to do with cookies I have set in my
web.config cookieless to "false" which was first set to "true" to try if
that works and it does. Is there a reason why the sessionstate is not
persistent when using cookieless sessions.

Gabriel Lozano-Morán


Marina said:
Is the browser set to allow session cookies? If not, that is why.

Gabriel Lozano-Morán said:
Is there any particular reason why the Session_Start() event gets
triggerend by each aspx page request?

Details:
Windows XP Pro SP2
.NET Framework v1.1.4322
C#
SessionState set to mode InProc in web.config
Session timeout set to 20 minutes

My Session_Start():
protected void Session_Start(Object sender, EventArgs e)
{
Session["LanguageId"] =
ConfigurationSettings.AppSettings["DefaultLanguageId"];
Session["Culture"] =
ConfigurationSettings.AppSettings["DefaultCulture"];
}

I have a frameset containing a banner frame - contents frame and a main
frame. I have set a breakpoint on the first line in my Session_Start.

When I start the application, the Session_Start gets triggerend once. For
each consequent requested aspx page loaded in the main frame by clicking
on a link in the contents frame will create for some reason a new
session. Nothing specials happens in these pages that might cause this
behaviour.

Any help or leads in the right direction are stronly appreciated.

Gabriel Lozano-Morán
 
M

Marina

If you are saying cookieless is working, then your question is why it would
not work when you are using session state with cookies?

The reason is that if the browser is set to not accept session cookies, the
server cannot check the value of this session cookie to get the sessionid.
Since it can't get the session id, it just creates a new session every time.

Gabriel Lozano-Morán said:
Hello Marina

Following your lead that it had to do with cookies I have set in my
web.config cookieless to "false" which was first set to "true" to try if
that works and it does. Is there a reason why the sessionstate is not
persistent when using cookieless sessions.

Gabriel Lozano-Morán


Marina said:
Is the browser set to allow session cookies? If not, that is why.

Gabriel Lozano-Morán said:
Is there any particular reason why the Session_Start() event gets
triggerend by each aspx page request?

Details:
Windows XP Pro SP2
.NET Framework v1.1.4322
C#
SessionState set to mode InProc in web.config
Session timeout set to 20 minutes

My Session_Start():
protected void Session_Start(Object sender, EventArgs e)
{
Session["LanguageId"] =
ConfigurationSettings.AppSettings["DefaultLanguageId"];
Session["Culture"] =
ConfigurationSettings.AppSettings["DefaultCulture"];
}

I have a frameset containing a banner frame - contents frame and a main
frame. I have set a breakpoint on the first line in my Session_Start.

When I start the application, the Session_Start gets triggerend once.
For each consequent requested aspx page loaded in the main frame by
clicking on a link in the contents frame will create for some reason a
new session. Nothing specials happens in these pages that might cause
this behaviour.

Any help or leads in the right direction are stronly appreciated.

Gabriel Lozano-Morán
 
G

Gabriel Lozano-Morán

No I meant that cookieless (url mangling) is not working and with cookies it
works.

cookieless="true" => not working (this would mean no cookies = no session)
cookieless="false"=> works (this means use cookies)

Gabriel

Marina said:
If you are saying cookieless is working, then your question is why it
would not work when you are using session state with cookies?

The reason is that if the browser is set to not accept session cookies,
the server cannot check the value of this session cookie to get the
sessionid. Since it can't get the session id, it just creates a new
session every time.

Gabriel Lozano-Morán said:
Hello Marina

Following your lead that it had to do with cookies I have set in my
web.config cookieless to "false" which was first set to "true" to try if
that works and it does. Is there a reason why the sessionstate is not
persistent when using cookieless sessions.

Gabriel Lozano-Morán


Marina said:
Is the browser set to allow session cookies? If not, that is why.

Is there any particular reason why the Session_Start() event gets
triggerend by each aspx page request?

Details:
Windows XP Pro SP2
.NET Framework v1.1.4322
C#
SessionState set to mode InProc in web.config
Session timeout set to 20 minutes

My Session_Start():
protected void Session_Start(Object sender, EventArgs e)
{
Session["LanguageId"] =
ConfigurationSettings.AppSettings["DefaultLanguageId"];
Session["Culture"] =
ConfigurationSettings.AppSettings["DefaultCulture"];
}

I have a frameset containing a banner frame - contents frame and a main
frame. I have set a breakpoint on the first line in my Session_Start.

When I start the application, the Session_Start gets triggerend once.
For each consequent requested aspx page loaded in the main frame by
clicking on a link in the contents frame will create for some reason a
new session. Nothing specials happens in these pages that might cause
this behaviour.

Any help or leads in the right direction are stronly appreciated.

Gabriel Lozano-Morán
 
G

Gabriel Lozano-Morán

Problem solved. In the content frame I was using the Microsoft Treeview web
control and the navigateUrl was set using the application path + page name
thus by doing this I removed the session id from the url... Thanks for
helping me on this one. Been working for 13 hours, time to go home.... :s

Gabriel Lozano-Morán

Gabriel Lozano-Morán said:
No I meant that cookieless (url mangling) is not working and with cookies
it works.

cookieless="true" => not working (this would mean no cookies = no session)
cookieless="false"=> works (this means use cookies)

Gabriel

Marina said:
If you are saying cookieless is working, then your question is why it
would not work when you are using session state with cookies?

The reason is that if the browser is set to not accept session cookies,
the server cannot check the value of this session cookie to get the
sessionid. Since it can't get the session id, it just creates a new
session every time.

Gabriel Lozano-Morán said:
Hello Marina

Following your lead that it had to do with cookies I have set in my
web.config cookieless to "false" which was first set to "true" to try if
that works and it does. Is there a reason why the sessionstate is not
persistent when using cookieless sessions.

Gabriel Lozano-Morán


Is the browser set to allow session cookies? If not, that is why.

Is there any particular reason why the Session_Start() event gets
triggerend by each aspx page request?

Details:
Windows XP Pro SP2
.NET Framework v1.1.4322
C#
SessionState set to mode InProc in web.config
Session timeout set to 20 minutes

My Session_Start():
protected void Session_Start(Object sender, EventArgs e)
{
Session["LanguageId"] =
ConfigurationSettings.AppSettings["DefaultLanguageId"];
Session["Culture"] =
ConfigurationSettings.AppSettings["DefaultCulture"];
}

I have a frameset containing a banner frame - contents frame and a
main frame. I have set a breakpoint on the first line in my
Session_Start.

When I start the application, the Session_Start gets triggerend once.
For each consequent requested aspx page loaded in the main frame by
clicking on a link in the contents frame will create for some reason a
new session. Nothing specials happens in these pages that might cause
this behaviour.

Any help or leads in the right direction are stronly appreciated.

Gabriel Lozano-Morán
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top