You are here

function _persistent_login_setcookie in Persistent Login 6

Same name and namespace in other branches
  1. 5 persistent_login.module \_persistent_login_setcookie()
  2. 7 persistent_login.module \_persistent_login_setcookie()

Set a cookie with the same options as the session cookie.

Parameters

$name: The name of the cookie.

$value: The value to store in the cookie.

$expire: The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. By default expires when the browser is closed.

2 calls to _persistent_login_setcookie()
persistent_login_user in ./persistent_login.module
Implementation of hook_user().
_persistent_login_create_cookie in ./persistent_login.module
Create a Persistent Login cookie.

File

./persistent_login.module, line 465
Provide a "Remember Me" checkbox in the login form.

Code

function _persistent_login_setcookie($name, $value, $expire = 0) {
  $params = session_get_cookie_params();
  setcookie($name, $value, $expire, $params['path'], $params['domain'], $params['secure']);
}