summaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/user.php b/lib/user.php
index 25f555b47b1..a64ce05f2c9 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -337,4 +337,20 @@ class OC_USER {
}
return false;
}
+
+ /**
+ * @brief Set cookie value to use in next page load
+ * @param string $username username to be set
+ */
+ public static function setUsernameInCookie($username){
+ setcookie("username", $username, mktime().time()+60*60*24*15);
+ }
+
+ /**
+ * @brief Remove cookie for "remember username"
+ */
+ public static function unsetUsernameInCookie(){
+ unset($_COOKIE["username"]);
+ setcookie("username", NULL, -1);
+ }
}