class AnonymousUserSession in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Session/AnonymousUserSession.php \Drupal\Core\Session\AnonymousUserSession
 
An account implementation representing an anonymous user.
Hierarchy
- class \Drupal\Core\Session\UserSession implements AccountInterface
- class \Drupal\Core\Session\AnonymousUserSession
 
 
Expanded class hierarchy of AnonymousUserSession
17 files declare their use of AnonymousUserSession
- ActiveLinkResponseFilterTest.php in core/
tests/ Drupal/ Tests/ Core/ EventSubscriber/ ActiveLinkResponseFilterTest.php  - AnonymousUserSessionTest.php in core/
tests/ Drupal/ Tests/ Core/ Session/ AnonymousUserSessionTest.php  - CommentFieldAccessTest.php in core/
modules/ comment/ tests/ src/ Kernel/ CommentFieldAccessTest.php  - CommentItem.php in core/
modules/ comment/ src/ Plugin/ Field/ FieldType/ CommentItem.php  - CommentLinksTest.php in core/
modules/ comment/ tests/ src/ Kernel/ Views/ CommentLinksTest.php  
File
- core/
lib/ Drupal/ Core/ Session/ AnonymousUserSession.php, line 8  
Namespace
Drupal\Core\SessionView source
class AnonymousUserSession extends UserSession {
  /**
   * Constructs a new anonymous user session.
   *
   * Intentionally don't allow parameters to be passed in like UserSession.
   */
  public function __construct() {
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            AccountInterface:: | 
                  constant | Role ID for anonymous users. | ||
| 
            AccountInterface:: | 
                  constant | Role ID for authenticated users. | ||
| 
            AnonymousUserSession:: | 
                  public | function | 
            Constructs a new anonymous user session. Overrides UserSession:: | 
                  |
| 
            UserSession:: | 
                  protected | property | The Unix timestamp when the user last accessed the site. | |
| 
            UserSession:: | 
                  protected | property | The email address of this account. | |
| 
            UserSession:: | 
                  public | property | The name of this account. | |
| 
            UserSession:: | 
                  protected | property | The preferred administrative language code of the account. | |
| 
            UserSession:: | 
                  protected | property | The preferred language code of the account. | |
| 
            UserSession:: | 
                  protected | property | List of the roles this user has. | |
| 
            UserSession:: | 
                  protected | property | The timezone of this account. | |
| 
            UserSession:: | 
                  protected | property | User ID. | |
| 
            UserSession:: | 
                  public | function | 
            Returns the unaltered login name of this account. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns the display name of this account. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns the email address of this account. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            The timestamp when the account last accessed the site. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns the preferred administrative language code of the account. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns the preferred language code of the account. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns a list of roles. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  protected | function | Returns the role storage object. | |
| 
            UserSession:: | 
                  public | function | 
            Returns the timezone of this account. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns the unaltered login name of this account. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Checks whether a user has a certain permission. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns the user ID or 0 for anonymous. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns TRUE if the account is anonymous. Overrides AccountInterface:: | 
                  |
| 
            UserSession:: | 
                  public | function | 
            Returns TRUE if the account is authenticated. Overrides AccountInterface:: |