Results 1 to 3 of 3

Thread: Session variables.....

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2001
    Posts
    37

    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?

  2. #2
    Hyperactive Member SoftwareMaker's Avatar
    Join Date
    Mar 2001
    Location
    Elbonia with Dilbert and Wally
    Posts
    322
    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 ***

  3. #3
    Lively Member gigsvoo's Avatar
    Join Date
    Oct 2000
    Location
    Malaysia
    Posts
    109

    Post

    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
  •  



Click Here to Expand Forum to Full Width