[Home]DoNewLogin

UseModWiki | RecentChanges | Preferences

Creates a new UserData - UserCookie pair

 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();
 }


UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited March 13, 2002 9:15 pm by dsl081-197-140.nyc2.dsl.speakeasy.net (diff)
Search: