|
-
Jan 29th, 2002, 07:29 PM
#1
Thread Starter
Member
Session variables.....
I was wondering if it was possible to store objects in session variables using ASP, like in JSP where you could define the scope of a usebean. That way I could have a presistant connection or recordset. But I've only heard of sessions that store String values.
Ex.
dim objCon
dim objRec
set objCon = Server.CreateObject("ADODB.Connection")
set objRec = Server.CreateObject("ADODB.Recordset")
objCon. .................
objCon.connect
objRec.open blah, blah, blah, blah, blah
Session("Recordset") = objRec '/OR Set Session("Recordset") = objRec
I'm going to try it after I get off work!!
Any ideas?
-
Jan 29th, 2002, 08:03 PM
#2
Hyperactive Member
It is not advisable to store objects use by session in session variables.
If you want to store an object b/w sessions, do it at the global.asa file
<OBJECT RUNAT=Server SCOPE=Session ID=sobjAdocn PROGID="Adodb.Connection">
REM Object Script
</OBJECT>
That way, anytime you point to sobjadocn, you will be referring to the adodb.connection object.
William T
Software Architect / Chief Software Developer
Softwaremaker.Net Pte Ltd
http://www.Softwaremaker.net
*** Things are always the darkest before they go pitch black ***
-
Jan 29th, 2002, 09:11 PM
#3
Lively Member
Session variables are evil! They hold up server perfomance degration. Moreover using cookies have vulnerables, does anyone has known or used a better way to do things but better method?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|