public static function SmartIp::setSession in Smart IP 8.3
Same name and namespace in other branches
- 8.4 src/SmartIp.php \Drupal\smart_ip\SmartIp::setSession()
- 8.2 src/SmartIp.php \Drupal\smart_ip\SmartIp::setSession()
Write session variable.
Parameters
string $key: The session variable to write. Pass 'smart_ip' to write the smart_ip data.
mixed $value: The value of session variable.
6 calls to SmartIp::setSession()
- DeviceGeolocation::isNeedUpdate in modules/
device_geolocation/ src/ DeviceGeolocation.php - Check if user's location needs update via client side.
- DeviceGeolocationController::saveLocation in modules/
device_geolocation/ src/ Controller/ DeviceGeolocationController.php - Google Geocoding ajax callback function data handler.
- device_geolocation_entity_insert in modules/
device_geolocation/ device_geolocation.module - Implements hook_entity_insert().
- device_geolocation_user_login in modules/
device_geolocation/ device_geolocation.module - Implements hook_user_login().
- SmartIpLocation::delete in src/
SmartIpLocation.php - Deletes the Smart IP location data in user data and session.
File
- src/
SmartIp.php, line 148 - Contains \Drupal\smart_ip\SmartIp.
Class
- SmartIp
- Smart IP static basic methods wrapper.
Namespace
Drupal\smart_ipCode
public static function setSession($key, $value) {
if (\Drupal::moduleHandler()
->moduleExists('session_cache')) {
session_cache_set($key, $value);
}
else {
/** @var \Symfony\Component\HttpFoundation\Session\Session $session */
$session = \Drupal::service('session');
$session
->set($key, $value);
}
}