/ Published in: C
![](/img/icon_sav.png?v3)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (BOOL) isActiveUser { NSDictionary *sessionInfo = (NSDictionary *) CGSessionCopyCurrentDictionary(); NSString *shortUserName = [sessionInfo valueForKey:kCGSessionUserNameKey]; NSString *userUID = [sessionInfo valueForKey:kCGSessionUserIDKey]; BOOL userIsActive = [[sessionInfo valueForKey:kCGSessionOnConsoleKey] boolValue]; NSString *loginCompleted = [sessionInfo valueForKey:kCGSessionLoginDoneKey]; NSLog(@"Session information: %@", sessionInfo); return userIsActive; }
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)