Best way to get data into called page: session or new database call??

P

Perdit

My 1st page calls a 2nd that uses same data from a database. What is
the best way to get the data in the second: a new call to the database
or passing array through session variable??

I seems to me that avoiding a new call will speed up things but my
concerne is that I have read many posts with caution messages againts
session vars.

Has anybody tested session var stability in this common scenario?

Thanks
 
B

Bob Barrows

Perdit said:
My 1st page calls a 2nd that uses same data from a database. What is
the best way to get the data in the second: a new call to the database
or passing array through session variable??

I seems to me that avoiding a new call will speed up things but my
concerne is that I have read many posts with caution messages againts
session vars.

Has anybody tested session var stability in this common scenario?

Thanks

How is the second page getting "called"? It is certainly possible in many
cases to pass data from one page to another without using session variables.
For example, you can use a querystring to pass the data to the second page.
Or, if submitting a form, just read the data from the Form variables
collection

Bob Barrows
 
N

Niel

Taking the information from session vairable is definitely faster but yes it
may also happen that the session values may have been lost.
You can make it conditional on the second page where you can check if the
values of session varibles are still in store from the previous page or not.
If not then make a call to database.
Also is the second page that you are calling, in the same domain.
I mean if the first page is in http and if the second page you are calling
is https (secured) then mind well that the session variables from the first
page won't work as the domain gets changed and so the session values will be
lost. In that case you can pass information from first page through
querystring or from the form variables.

Niel
 
P

Perdit

Yes, I forgot to say that session or database asp were the options I
wanted to ask about. I could not pass FORM variables and wanted to
avoid URL querystring.

The session variables are available since I just open a new window
with the called page. I was now wondering under what circumstances
the session vars would not be available aside from the intrinsic
session limitations.

Thanks
 
A

Aaron Bertrand [MVP]

Taking the information from session vairable is definitely faster

Faster than what? And no matter what your answer is, this is not a given...
it really depends.
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top