How to use "session_start"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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: <[email protected]>
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: (e-mail address removed)
 
Back
Top