diff -ruN ./logincookie.admin.inc ../logincookie.patched/logincookie.admin.inc
--- ./logincookie.admin.inc	2011-08-02 10:18:44.000000000 -0500
+++ ../logincookie.patched/logincookie.admin.inc	2011-08-02 09:50:42.000000000 -0500
@@ -81,6 +81,25 @@
     '#description'=> t('The value of the cookie. This value is stored on the clients computer; do not store sensitive information.'),
     '#default_value' => isset($cookie['value']) ? $cookie['value'] : '',
   );
+  if (module_exists('token')) {
+    $form['token_help'] = array(
+      '#title' => t('Replacement patterns'),
+      '#type' => 'fieldset',
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+    );
+    foreach (array('global', 'user') as $name) {
+      $form['token_help'][$name] = array(
+        '#type' => 'fieldset',
+        '#title' => t('@name replacement patterns', array('@name' => drupal_ucfirst($name))),
+        '#collapsible' => TRUE,
+        '#collapsed' => TRUE,
+      );
+      $form['token_help'][$name]['content'] = array(
+        '#value' => theme('token_help', $name),
+      );
+    }
+  }
   $form['expire'] = array(
     '#type'       => 'textfield',
     '#title'      => 'Cookie expire',
diff -ruN ./logincookie.module ../logincookie.patched/logincookie.module
--- ./logincookie.module	2009-07-21 01:24:35.000000000 -0500
+++ ../logincookie.patched/logincookie.module	2011-08-02 09:53:33.000000000 -0500
@@ -143,6 +143,10 @@
     foreach ($cookies as $what => $values) {
       foreach ($values as $name => $cookie) {
         if ( $what == 'set') {
+          if (module_exists('token')) {
+            $cookie['value'] = token_replace($cookie['value'], $type = 'global');
+            $cookie['value'] = token_replace($cookie['value'], $type = 'user', $account);
+          }
           setcookie($cookie['name'], $cookie['value'], time() + $cookie['expire'], $cookie['path'], $cookie['domain'], (bool)$cookie['secure']);
         }
         elseif ($what == 'unset') {
