Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session variables - should they be put into local variables?

Status
Not open for further replies.

spastica

Programmer
Sep 27, 2002
72
GB
I have creating an editable online application form which uses session variables for all form fields so that users may go back and edit their info before submittign the form, which is emailed from the server side. before the users submit, they are presented with a page with all the details they entered so they can print for their records.

my question is, when i am displaying the session variable values in the "review" page and when i am sending them in the email, is it better to first put them into local variables and then call those local variables in to display the info? will calling the session variables straight into the page cause more server stress? which is the better method?

any input would be greatly appreciated!

thanks in advance :)
 
I don't think so. But you do want to destroy the session variables eventually.

Code:
Set Session("somevariable") = Nothing

Otherwise they will take up server memory until the Session Expires either by Timeout or by your code.

ToddWW
 
better straight from session --> page
otherwise you have session variable X taking so much memory, then you're creating a temp variable in page, X*2 memory because the session variable doesn't go away unless you clear it as mentioned by todd. so in essence you're doubling up the resources needed by the page. port the session value to a variable when you want to manipulate it in some way before passing it back instead of constantly read/writing the session values.

per chance tarwn might toss in $0.02 on this, he's got a thing for efficiency and short code.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
thank you - i wanted to be sure and get some expert opinions :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top