SessionManagerInterface.php 1.71 KB
Newer Older
1 2 3 4 5 6 7 8 9
<?php

/**
 * @file
 * Contains \Drupal\Core\Session\SessionManagerInterface.
 */

namespace Drupal\Core\Session;

10 11
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;

12 13 14
/**
 * Defines the session manager interface.
 */
15
interface SessionManagerInterface extends SessionStorageInterface {
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

  /**
   * Ends a specific user's session(s).
   *
   * @param int $uid
   *   User ID.
   */
  public function delete($uid);

  /**
   * Determines whether to save session data of the current request.
   *
   * @return bool
   *   FALSE if writing session data has been disabled. TRUE otherwise.
   */
  public function isEnabled();

  /**
   * Temporarily disables saving of session data.
   *
   * This function allows the caller to temporarily disable writing of
   * session data, should the request end while performing potentially
   * dangerous operations, such as manipulating the global $user object.
   *
   * @see https://drupal.org/node/218104
   *
   * @return $this
   */
  public function disable();

  /**
   * Re-enables saving of session data.
   *
   * @return $this
   */
  public function enable();

53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
  /**
   * Returns whether mixed mode SSL sessions are enabled in the session manager.
   *
   * @return bool
   *   Value of the mixed mode SSL sessions flag.
   */
  public function isMixedMode();

  /**
   * Enables or disables mixed mode SSL sessions in the session manager.
   *
   * @param bool $mixed_mode
   *   New value for the mixed mode SSL sessions flag.
   */
  public function setMixedMode($mixed_mode);

  /**
   * Returns the name of the insecure session when operating in mixed mode SSL.
   *
   * @return string
   *   The name of the insecure session.
   */
  public function getInsecureName();

77
}