A beginners question about Session.abandon

W

What-a-Tool

I've got a bit of experience coding in VB.Net and VBA, but as I don't have
the software to debug an ASP web application, I'm having a bit of trouble
figuring out exactly how my code is performing/behaving on the server.
Because of this, I'm kinda unsure about the performance/function of
Session.Abandon
Below is a trimmed down version of some code that I'm using to redirect to
my home page. Now in a standard VB/VBA module, my code would leave this
procedure with the "redirect", perform whatever code/action occured there,
and then end up back here to finish out the remaining code in this
procedure. Will it perform the same here? If thats the case, the placement
of Session.Abandon at the end of my initial calling procedure should be
good. Or should there be Session.Abandon at the end of each other page that
is called, also?

Any enlightenment would be greatly appreciated.

Dim blnAdjust, objBCp, brwsrtype, brwsrver, usrAgnt
Set objBCp = Server.CreateObject("MSWC.BrowserType")
If (objBCp.browser)="IE" Then
Response.Redirect("init/iehome.asp")
ElseIf (objBCp.browser)="Default" Then
Response.Redirect("init/dhome.asp")
ElseIf (objBCp.javascript) And (objBCp.cookies) Then
Response.Redirect("init/ubghome.asp")
Else
Response.Redirect("init/nghome.asp")
End If

Set objBCp = Nothing
Session.Abandon


-- Thanks

/ Sean the Mc /

"Opinions are like flatulence - everyone loves the sound of their own, but
anyone else's usually just stinks !"
-anonymous
 
B

Bob Barrows [MVP]

What-a-Tool said:
I've got a bit of experience coding in VB.Net and VBA, but as I don't
have the software to debug an ASP web application, I'm having a bit
of trouble figuring out exactly how my code is performing/behaving on
the server. Because of this, I'm kinda unsure about the
performance/function of Session.Abandon
Below is a trimmed down version of some code that I'm using to
redirect to my home page. Now in a standard VB/VBA module, my code
would leave this procedure with the "redirect", perform whatever
code/action occured there, and then end up back here to finish out
the remaining code in this procedure. Will it perform the same here?

No. Redirect causes the browser to submit its request to a different page.
The current page's response immediately ends. You can use Server.Execute if
you wish to run another page without leaving the current page.
If thats the case, the placement of Session.Abandon at the end of my
initial calling procedure should be good. Or should there be
Session.Abandon at the end of each other page that is called, also?

Depends on if you want it to run.

Bob Barrows
 
W

What-a-Tool

Thank You - Between your answer, and what Google thru at me, I think I have
a much better idea

--

/ Sean the Mc /

"Opinions are like flatulence - everyone loves the sound of their own, but
anyone else's usually just stinks !"
-anonymous
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top