diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index a16d2c9e55d0f0807695427f99871c7676a3cad6..fb63200123eb39908b4dda63ad573098c76605a9 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 	<head>
-		<title><?php echo isset($_['application']) && !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud <?php echo OC_User::getUser()?' ('.OC_User::getUser().') ':'' ?></title>
+		<title><?php echo isset($_['application']) && !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud <?php echo OC_User::getDisplayName()?' ('.OC_User::getDisplayName().') ':'' ?></title>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 		<link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" />
 		<?php foreach($_['cssfiles'] as $cssfile): ?>
diff --git a/lib/user.php b/lib/user.php
index d6d47293cbb3e9a0723273496c194da5a33fac88..f9c8f48568e72e26e7d3414c69fd356225b8bcc0 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -351,7 +351,7 @@ class OC_User {
 	 * @return string uid or false
 	 */
 	public static function getDisplayName() {
-		if( isset($_SESSION['user_id']) AND $_SESSION['user_id'] ) {
+		if( isset($_SESSION['display_name']) AND $_SESSION['display_name'] ) {
 			return $_SESSION['display_name'];
 		}
 		else{