473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Why so many Session_Start events.

I have a frameset with multiple aspx pages whithin it.

I lauch the page and notice that it triggers many session_start events. In
fact I knotice multiple events for the same page.

I am also using windows authentication.
On a few pages I get guest and then the user who is loged into the computer.

I am writing user information to my session and do not want it writen 8
times.

I can resort to loading my object in the first page but thought that it was
more elegent to do so in the session_start event.

Ideas?

-Scott
Nov 15 '05 #1
4 5889
I attempted to simulate this error and Session_Start only
runs once for me. How do you know that it fires many
session_start events?

JER
-----Original Message-----
I have a frameset with multiple aspx pages whithin it.

I lauch the page and notice that it triggers many session_start events. Infact I knotice multiple events for the same page.

I am also using windows authentication.
On a few pages I get guest and then the user who is loged into the computer.
I am writing user information to my session and do not want it writen 8times.

I can resort to loading my object in the first page but thought that it wasmore elegent to do so in the session_start event.

Ideas?

-Scott
.

Nov 15 '05 #2
I use the debuger to step though the program. (Is this a debuger
problem?)

In the debuger window I look at the following vars:
Request.ServerVariables["AUTH_USER"]
Request.ServerVariables["URL"]

I notice that I get guest logons in addition to the user loged in to my box.

I am useing a frameset with multiple .aspx pages.

My code in global.
protected void Session_Start(Object sender, EventArgs e)

{

if (!User.Identity.IsAuthenticated) {

Response.Redirect("hayStupidLogon.aspx");

}

else {

try {

string auth_user =
Request.ServerVariables["AUTH_USER"].Substring(Request.ServerVariables["AUTH
_USER"].IndexOf("\\") + 1);

user loggedInUser = new user(auth_user);

Session["userSettings"] = loggedInUser;

}

catch ( userException ue ) {

//redirect

}

catch ( Exception ex ) {

//redirect

}

}

}

My authentication from web.config

<authentication mode="Windows" />

<!-- AUTHORIZATION

This section sets the authorization policies of the application. You can
allow or deny access

to application resources by user or role. Wildcards: "*" mean everyone, "?"
means anonymous

(unauthenticated) users.

-->

<authorization>

<deny users="?" /> <!-- Allow only athenticated users -->

<!-- <allow users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

<deny users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

-->

</authorization>

"Jerry Negrelli" <je************@nospamdatascientific.com> wrote in message
news:05****************************@phx.gbl...
I attempted to simulate this error and Session_Start only
runs once for me. How do you know that it fires many
session_start events?

JER
-----Original Message-----
I have a frameset with multiple aspx pages whithin it.

I lauch the page and notice that it triggers many

session_start events. In
fact I knotice multiple events for the same page.

I am also using windows authentication.
On a few pages I get guest and then the user who is

loged into the computer.

I am writing user information to my session and do not

want it writen 8
times.

I can resort to loading my object in the first page but

thought that it was
more elegent to do so in the session_start event.

Ideas?

-Scott
.

Nov 15 '05 #3
Is the main frameset an aspx page too? Cause theoretically if the frameset
was an .HTM file then a session wouldnt be started until the frames loaded,
each getting their own session id since the browser had no session cookie to
start the frames with...

The potentially easy fix would be to just rename the frameset to .aspx
--
Eric Newton
C#/ASP Application Developer
er**@cc.ensoft-software.com [remove the first "CC."]

"Curious George" <mu*****@hotmail.nospam> wrote in message
news:ey**************@TK2MSFTNGP09.phx.gbl...
I use the debuger to step though the program. (Is this a debuger
problem?)

In the debuger window I look at the following vars:
Request.ServerVariables["AUTH_USER"]
Request.ServerVariables["URL"]

I notice that I get guest logons in addition to the user loged in to my box.
I am useing a frameset with multiple .aspx pages.

My code in global.
protected void Session_Start(Object sender, EventArgs e)

{

if (!User.Identity.IsAuthenticated) {

Response.Redirect("hayStupidLogon.aspx");

}

else {

try {

string auth_user =
Request.ServerVariables["AUTH_USER"].Substring(Request.ServerVariables["AUTH _USER"].IndexOf("\\") + 1);

user loggedInUser = new user(auth_user);

Session["userSettings"] = loggedInUser;

}

catch ( userException ue ) {

//redirect

}

catch ( Exception ex ) {

//redirect

}

}

}

My authentication from web.config

<authentication mode="Windows" />

<!-- AUTHORIZATION

This section sets the authorization policies of the application. You can
allow or deny access

to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous

(unauthenticated) users.

-->

<authorization>

<deny users="?" /> <!-- Allow only athenticated users -->

<!-- <allow users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

<deny users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

-->

</authorization>

"Jerry Negrelli" <je************@nospamdatascientific.com> wrote in message news:05****************************@phx.gbl...
I attempted to simulate this error and Session_Start only
runs once for me. How do you know that it fires many
session_start events?

JER
-----Original Message-----
I have a frameset with multiple aspx pages whithin it.

I lauch the page and notice that it triggers many

session_start events. In
fact I knotice multiple events for the same page.

I am also using windows authentication.
On a few pages I get guest and then the user who is

loged into the computer.

I am writing user information to my session and do not

want it writen 8
times.

I can resort to loading my object in the first page but

thought that it was
more elegent to do so in the session_start event.

Ideas?

-Scott
.


Nov 15 '05 #4
Thanks for the idea. I had not though of that and will keep it in mind in
the future.

In this case though my first page is default.aspx.

"Eric Newton" <er**@cc.ensoft-software.com> wrote in message
news:e9**************@TK2MSFTNGP11.phx.gbl...
Is the main frameset an aspx page too? Cause theoretically if the frameset was an .HTM file then a session wouldnt be started until the frames loaded, each getting their own session id since the browser had no session cookie to start the frames with...

The potentially easy fix would be to just rename the frameset to .aspx
--
Eric Newton
C#/ASP Application Developer
er**@cc.ensoft-software.com [remove the first "CC."]

"Curious George" <mu*****@hotmail.nospam> wrote in message
news:ey**************@TK2MSFTNGP09.phx.gbl...
I use the debuger to step though the program. (Is this a debuger
problem?)

In the debuger window I look at the following vars:
Request.ServerVariables["AUTH_USER"]
Request.ServerVariables["URL"]

I notice that I get guest logons in addition to the user loged in to my

box.

I am useing a frameset with multiple .aspx pages.

My code in global.
protected void Session_Start(Object sender, EventArgs e)

{

if (!User.Identity.IsAuthenticated) {

Response.Redirect("hayStupidLogon.aspx");

}

else {

try {

string auth_user =

Request.ServerVariables["AUTH_USER"].Substring(Request.ServerVariables["AUTH
_USER"].IndexOf("\\") + 1);

user loggedInUser = new user(auth_user);

Session["userSettings"] = loggedInUser;

}

catch ( userException ue ) {

//redirect

}

catch ( Exception ex ) {

//redirect

}

}

}

My authentication from web.config

<authentication mode="Windows" />

<!-- AUTHORIZATION

This section sets the authorization policies of the application. You can
allow or deny access

to application resources by user or role. Wildcards: "*" mean everyone,

"?"
means anonymous

(unauthenticated) users.

-->

<authorization>

<deny users="?" /> <!-- Allow only athenticated users -->

<!-- <allow users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

<deny users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

-->

</authorization>

"Jerry Negrelli" <je************@nospamdatascientific.com> wrote in

message
news:05****************************@phx.gbl...
I attempted to simulate this error and Session_Start only
runs once for me. How do you know that it fires many
session_start events?

JER

>-----Original Message-----
>I have a frameset with multiple aspx pages whithin it.
>
>I lauch the page and notice that it triggers many
session_start events. In
>fact I knotice multiple events for the same page.
>
>I am also using windows authentication.
>On a few pages I get guest and then the user who is
loged into the computer.
>
>I am writing user information to my session and do not
want it writen 8
>times.
>
>I can resort to loading my object in the first page but
thought that it was
>more elegent to do so in the session_start event.
>
>Ideas?
>
>-Scott
>
>
>.
>



Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Chris Allen | last post by:
Hi I'm new to PHP and I'm trying to create a Login Form. Once the user has logged in then he shouldn't have to log in again. The trouble is I'm getting a new session ID between every page and so...
1
by: Mercy | last post by:
Hi, I'm a newbie. I was trying to figure out how to use the Session_start method? The reference books I'm reading say that a session STARTS when "session_start" is called. But ... in their sample...
0
by: Steve Donnelly | last post by:
I have an HttpModule that gets the SessionStateModule and registers for the Start and End events. Global receives both Start and End events (both timeout and when Session.Abandon() is called),...
2
by: Jeanne Louw | last post by:
Hi Why would this happen? The Application_Start and Session_Start events fires on each page request on my website. SessionID stays the same between page requests. <sessionState mode="InProc"...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
4
by: csn | last post by:
Is it possible to have a Response.Redirect in Global.asax in the Application_Start and Session_Start events? We have code in both events, with try-catch blocks, and if an exception is caught, we...
19
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
5
by: greg | last post by:
Written in Asp.Net 2.0 The session_start fires on Development server running withing Visual Studio 2005 and also if access web site via localhost on development machine. But if copy to...
2
by: larry | last post by:
using session_start() on a script - if there is no session it sets one up; if there is a session, it opens it. If you wait too long between pages it disposes the session automatically (set time...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.