Null values wiping out session variables

Results 1 to 2 of 2

Thread: Null values wiping out session variables

  1. #1
    Join Date
    Dec 1969

    Default Null values wiping out session variables

    I recently saw a situation where a gif file name was being loaded in a session variable. In cases where the value loaded was null, it wiped out all the other session variables, as if a session.abandon was being done. Any one else see this behavior?<BR><BR>Any fixes?

  2. #2
    SPG Guest

    Default RE: Null values wiping out session variables

    if len(strFileName) &#060;= 0 then Don&#039t Use It!<BR>if youReallyNeedToUseIt then session("fileName") = ""<BR><BR>Alternately, session("fileName") = cStr(strFileName) will convert NULL to "".<BR><BR>&#060;speculation quality=pure&#062;<BR>This behavior probably stems from the database world where a NULL is an infinite limbo state incapable of anything and capable of everything (and therefore good for nothing). I&#039ve seen a NULL from a database eat a string from same database in what looked like normal string concating. Since then, I&#039ve started coalesce(field, &#039&#039) optional database fields.<BR><BR>Anyway, what I would guess is going on is that the null value is somehow corrupting your session hash (dictionary, type, object whatever), thus giving the general impression that a session.abandon has occurred.<BR>&#060;/speculation&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts