setLoginCookie

Description

Sets the SMF-style login cookie and session based on the ID_MEMBER and password passed.

Syntax

void setLoginCookie (int $cookie_length, int $id[, string $password])



Parameter $cookie_length

Expected type: Integer
Description: How long the cookie should last (in milliseconds)



Parameter $id

Expected type: Integer
Description: The member ID



Parameter $password

Expected type: String
Description: The user's password


Notes

  • Logs the user out if ID_MEMBER is zero.
  • Sets the cookie and session to last the number of seconds specified by cookie_length.
  • When logging out, if the globalCookies setting is enabled, attempts to clear the subdomain's cookie too.
  • Gets cookie name from $cookiename global variable
Advertisement: