in reply to Using clone/dclone with threads

I think you need to do this $cfg::sessions{A}||={}; before clone/dclone.