auto_login

Description

This method lets you auto sign-in a user to your site.

Usage

<?php $ultimatemember->user->auto_login( $user_id, $rememberme = false ); ?>

Parameters

$user_id

(numeric) (required) Which user ID to sign in automatically

$rememberme

(boolean) (optional) Should be true or false. If you want the user sign in session to use cookies, use true

Returns

Sign in the specified user automatically.

Examples

The following example lets you sign in a user automatically by their ID.

<?php $ultimatemember->user->auto_login( 2 ); ?>

The following example lets you sign in a user automatically by their ID and makes the plugin remember their session.

<?php $ultimatemember->user->auto_login( 10, true ); ?>