/**
  * @param string $projectId
  * @param string $userId
  * @param Website $website
  * @return array
  */
 public static function getSessionData($projectId, $userId, $website)
 {
     $sessionData = array();
     $sessionData['userId'] = (string) $userId;
     $sessionData['baseSite'] = $website->base;
     // Rights
     $user = new UserModel($userId);
     $sessionData['userSiteRights'] = $user->getRightsArray($website);
     if ($projectId) {
         $project = ProjectModel::getById($projectId);
         $sessionData['project'] = array();
         $sessionData['project']['id'] = (string) $projectId;
         $sessionData['project']['projectName'] = $project->projectName;
         $sessionData['project']['appName'] = $project->appName;
         $sessionData['project']['appLink'] = "/app/{$project->appName}/{$projectId}/";
         $sessionData['project']['ownerRef'] = $project->ownerRef->asString();
         $sessionData['project']['slug'] = $project->databaseName();
         $sessionData['userProjectRights'] = $project->getRightsArray($userId);
         $sessionData['projectSettings'] = $project->getPublicSettings($userId);
     }
     // File Size
     $postMax = self::fromValueWithSuffix(ini_get("post_max_size"));
     $uploadMax = self::fromValueWithSuffix(ini_get("upload_max_filesize"));
     $fileSizeMax = min(array($postMax, $uploadMax));
     $sessionData['fileSizeMax'] = $fileSizeMax;
     //return JsonEncoder::encode($sessionData);  // This is handled elsewhere
     return $sessionData;
 }