sub DoNewLogin { # Later consider warning if cookie already exists # (maybe use "replace=1" parameter) &CreateUserDir(); $SetCookie{'id'} = &GetNewUserId?; $SetCookie{'randkey'} = int(rand(1000000000)); $SetCookie{'rev'} = 1; %UserCookie = %SetCookie; $UserID = $SetCookie{'id'}; # The cookie will be transmitted in the next header %UserData = %UserCookie; $UserData{'createtime'} = $Now; $UserData{'createip'} = $ENV{REMOTE_ADDR}; &SaveUserData(); }