simple question on vbScript SET statement

Discussion in 'ASP General' started by qwestion@qwestion.com, Jul 17, 2004.

  1. Guest

    Simply:

    On one .asp page I have:
    Set Session("mydictionary") = [dictionary object]

    Now the session variable has the dictionary object in it, then on
    another page ...

    Set x = Session("mydictionary")
    .... and I use the "x" variable with the properties of that object,
    etc.

    Question:
    Is "Set x = nothing" needed before the .asp page ends processing or
    redirects?

    From what I know the "x" variable is just a reference and does not
    need to be set to "nothing"... correct?
    , Jul 17, 2004
    #1
    1. Advertising

  2. dlbjr Guest

    Do Not use Dictionaries as a Session or Application Variable!

    I would serialize the data to a string, then encrypt it and place in a hidden field on the page.
    When the next page calls the server, deserialize the data, load the object, and do what ever.
    This will reduce the use of session vars and ram on the server. Remember the site will only grow, so
    built it scalable.

    dlbjr
    Pleading sagacious indoctrination!
    dlbjr, Jul 17, 2004
    #2
    1. Advertising

  3. wrote:
    > Simply:
    >
    > On one .asp page I have:
    > Set Session("mydictionary") = [dictionary object]
    >
    > Now the session variable has the dictionary object in it, then on
    > another page ...
    >
    > Set x = Session("mydictionary")
    > ... and I use the "x" variable with the properties of that object,
    > etc.
    >
    > Question:
    > Is "Set x = nothing" needed before the .asp page ends processing or
    > redirects?
    >
    > From what I know the "x" variable is just a reference and does not
    > need to be set to "nothing"... correct?


    Don't put a Dictionary object in Session:
    http://blogs.msdn.com/ericlippert/archive/2003/09/18/53050.aspx
    http://blogs.msdn.com/ericlippert/archive/2003/09/19/53054.aspx

    A good alternative is a free-threaded XML document.


    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jul 17, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Di Guillielmo
    Replies:
    6
    Views:
    8,336
    Aaron J. Scott
    Aug 27, 2003
  2. Matt
    Replies:
    3
    Views:
    238
    Rob Greene
    Jan 11, 2004
  3. Replies:
    3
    Views:
    653
    Anthony Jones
    Nov 2, 2006
  4. Replies:
    1
    Views:
    147
    Anthony Jones
    Jul 27, 2007
  5. Colin Graham
    Replies:
    9
    Views:
    176
    kaeli
    Apr 26, 2005
Loading...

Share This Page