RE: How to use "session_start"

From: John Kn [MS] (johnknox_at_online.microsoft.com)
Date: 06/01/04


Date: Tue, 01 Jun 2004 00:51:25 GMT

Mercy,

The first time the page is opened, the Start event is raised for the
application and the session:

/*C#*/
void Application_Start(object sender, EventArgs e) {
  // Application startup code goes here
}

void Session_Start(object sender, EventArgs e) {
  Response.Write("Session is Starting...<br>");
  Session.Timeout = 1;
}

//VB.Net
Sub Application_Start(Sender As Object, E As EventArgs)
  ' Application startup code goes here
End Sub

Sub Session_Start(Sender As Object, E As EventArgs)
  Response.Write("Session is Starting...<br>")
  Session.Timeout = 1
End Sub

//JScript
function Application_Start(sender:Object, E:EventArgs) : void {
  // Application startup code goes here
}

function Session_Start(sender:Object, e:EventArgs) : void {
  Response.Write("Session is Starting...<br>");
  Session.Timeout = 1;
}

 I hope this helps.
BTW: A Newbie's best friend is at ASP.Net QUick Start Tutorials:
http://www.asp.net/tutorials/quickstart.aspx

--------------------
>Thread-Topic: How to use "session_start"
>thread-index: AcQ2I0e2vSj0p98cRKqQRLPw6EfsaQ==
>X-WN-Post: microsoft.public.dotnet.general
>From: "=?Utf-8?B?TWVyY3k=?=" <zuo_mongatNOSPAMhotmaildotcom>
>Subject: How to use "session_start"
>Date: Sun, 9 May 2004 17:11:02 -0700
>Lines: 7
>Message-ID: <AE09D457-21CA-42E1-9DBF-DB27E335EDD4@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.dotnet.general
>Path: cpmsftngxa10.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.general:133476
>NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
>X-Tomcat-NG: microsoft.public.dotnet.general
>
>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 101 on this topic of sessions.
Thanks,
Mercy
>

Cheers,

johnKn [MS-SDK]

 

-Please do not send email directly to this alias. This alias is for
newsgroup purposes only

 

-This posting is provided “AS IS” with no warranties, and confers no rights.

 

-To provide additional feedback about your community experience please send
e-mail to: sdkcomm@microsoft.com



Relevant Pages

  • Re: where is global.asax.cs ?
    ... void Application_Start(object sender, EventArgs e) ... de session a la valeur StateServer ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: implementing users counting with global.asax
    ... Session is required from the user, or everytime that timesout and need to ... void Application_OnStart(object sender, EventArgs e) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Session object is NULL in HTTP handler
    ... session in a cookie but the context.session is null. ... Here in the code, the cookieValue is allways without session, ... ... protected void Application_BeginRequest{ ... private void Application_AuthenticateRequest(object source, EventArgs e) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Device.Lights[]
    ... > device.SetTransform(TransformType.World, matWorld); ... > void cbLight1_Changed(object sender, EventArgs e) ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: postback issue
    ... EventArgs e) ...    protected void tester_SelectedIndexChanged(object sender, ... it seems the postback and redirect is ...
    (microsoft.public.dotnet.framework.aspnet)