473,756 Members | 3,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5914
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.ServerV ariables["AUTH_USER"]
Request.ServerV ariables["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(O bject sender, EventArgs e)

{

if (!User.Identity .IsAuthenticate d) {

Response.Redire ct("hayStupidLo gon.aspx");

}

else {

try {

string auth_user =
Request.ServerV ariables["AUTH_USER"].Substring(Requ est.ServerVaria bles["AUTH
_USER"].IndexOf("\\") + 1);

user loggedInUser = new user(auth_user) ;

Session["userSettin gs"] = loggedInUser;

}

catch ( userException ue ) {

//redirect

}

catch ( Exception ex ) {

//redirect

}

}

}

My authentication from web.config

<authenticati on 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

(unauthenticate d) users.

-->

<authorizatio n>

<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************ @nospamdatascie ntific.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*****@hotmai l.nospam> wrote in message
news:ey******** ******@TK2MSFTN GP09.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.ServerV ariables["AUTH_USER"]
Request.ServerV ariables["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(O bject sender, EventArgs e)

{

if (!User.Identity .IsAuthenticate d) {

Response.Redire ct("hayStupidLo gon.aspx");

}

else {

try {

string auth_user =
Request.ServerV ariables["AUTH_USER"].Substring(Requ est.ServerVaria bles["AUTH _USER"].IndexOf("\\") + 1);

user loggedInUser = new user(auth_user) ;

Session["userSettin gs"] = loggedInUser;

}

catch ( userException ue ) {

//redirect

}

catch ( Exception ex ) {

//redirect

}

}

}

My authentication from web.config

<authenticati on 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

(unauthenticate d) users.

-->

<authorizatio n>

<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************ @nospamdatascie ntific.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.enso ft-software.com> wrote in message
news:e9******** ******@TK2MSFTN GP11.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*****@hotmai l.nospam> wrote in message
news:ey******** ******@TK2MSFTN GP09.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.ServerV ariables["AUTH_USER"]
Request.ServerV ariables["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(O bject sender, EventArgs e)

{

if (!User.Identity .IsAuthenticate d) {

Response.Redire ct("hayStupidLo gon.aspx");

}

else {

try {

string auth_user =

Request.ServerV ariables["AUTH_USER"].Substring(Requ est.ServerVaria bles["AUTH
_USER"].IndexOf("\\") + 1);

user loggedInUser = new user(auth_user) ;

Session["userSettin gs"] = loggedInUser;

}

catch ( userException ue ) {

//redirect

}

catch ( Exception ex ) {

//redirect

}

}

}

My authentication from web.config

<authenticati on 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

(unauthenticate d) users.

-->

<authorizatio n>

<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************ @nospamdatascie ntific.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
11152
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 it doesn't recognise the user. I've used Session_Start() which I thought was meant to maintain the session variables between pages but it doesn't do work. Any ideas or FAQ's?
1
8928
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 code... I never see that explicitly called. Is it supposed to be called from the Global.asa file (still not sure what that is...) Is "session_start" a server-side scripting thing? Or a client-side scripting thing? I'd really appreciate a nice...
0
1975
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), but my module receives only the Start event. SessionMode is InProc. Commenting out Global's Session_End() does not have any effect. Does anyone know why Session_End() is not called?
2
3395
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" in WebConfig.> Session state is also not set to readonly in any page directives. I set a session variable in the Session_Start event that gets changed
5
2175
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. Create a new C# ASP.NET web application named "demo" and modify Session_Start in Global.asax.cs as follows: protected void Session_Start(Object sender, EventArgs e) { Response.Write("Session_Start event fired at "+
4
6683
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 wanted to redirect to an error page. But, this doesn't seem to work. So, another question is, if an exception is thrown and caught in a catch block in Application_Start and/or Session_Start, what do we or can we do with it?
19
7927
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 limiter - headers already sent in /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSession.php on line 14
5
2078
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 development machine event does not fire I created a barebones webapplication not website and put code in session_start will not fire
2
1813
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 for session to keep alive in php.ini). You need session_start() on all pages that needs to access the $_SESSION array. $_SESSION is just like an array variable, so if you want to segregate data you could set a sub array of page data in...
0
9431
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9255
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9844
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8688
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7226
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3780
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2647
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.