本文整理汇总了PHP中Illuminate\Session\SessionManager::forget方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager::forget方法的具体用法?PHP SessionManager::forget怎么用?PHP SessionManager::forget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Session\SessionManager
的用法示例。
在下文中一共展示了SessionManager::forget方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
/**
* Show the login form
*
* @return mixed
*/
public function getIndex()
{
if ($this->request->ajax()) {
$this->session->forget('url.intended');
}
return View::make('auth.login');
}
示例2: setLocation
/**
* Sets the location property to the drivers returned location object.
*
* @param string $ip
*/
private function setLocation($ip = '')
{
// The location session key.
$key = 'location';
// Removes location from the session if config option is set
if ($this->localHostForgetLocation()) {
$this->session->forget($key);
}
// Check if the location has already been set in the current session
if ($this->session->has($key)) {
// Set the current driver to the current session location
$this->location = $this->session->get($key);
} else {
$this->setIp($ip);
$this->location = $this->driver->get($this->ip);
// The locations object property 'error' will be true if an
// exception has occurred trying to grab the location
// from the driver. Let's try retrieving the
// location from one of our fall-backs
if ($this->location->error) {
$this->location = $this->getLocationFromFallback();
}
$this->session->set($key, $this->location);
}
}
示例3: fileDownload
/**
* The GET method that runs when a user needs to download a file
*
* @return JSON
*/
public function fileDownload()
{
if ($response = $this->session->get('administrator_download_response')) {
$this->session->forget('administrator_download_response');
$filename = substr($response['headers']['content-disposition'][0], 22, -1);
return response()->download($response['file'], $filename, $response['headers']);
} else {
return redirect()->back();
}
}
示例4: clearPersistentData
/**
* {@inheritdoc}
*
* @see BaseFacebook::clearPersistentData()
*/
protected function clearPersistentData($key)
{
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to clearPersistentData.');
return;
}
$session_var_name = $this->constructSessionVariableName($key);
if ($this->laravelSession->has($session_var_name)) {
$this->laravelSession->forget($session_var_name);
}
}
示例5: getExisting
/**
* Get all alert from session flash
* @return void
*/
public function getExisting()
{
// Create message bag
if (!$this->bag) {
$this->bag = new MessageBag();
}
// Get messges from flash
$flash = $this->session->get(self::SESSION_KEY);
// Add Laravel errors
if ($errors = $this->session->get('errors')) {
foreach ($errors->all() as $error) {
$this->bag->add('error', $error);
}
}
if ($flash) {
foreach ($flash as $type => $alerts) {
if (is_array($alerts) and count($alerts)) {
foreach ($alerts as $alert) {
$this->bag->add($type, $alert);
}
}
}
}
foreach (array('success', 'error', 'warning') as $key) {
if ($message = $this->session->get($key)) {
// Get type
$type = $key;
if (!$type) {
$type = 'info';
}
// Add the message
$this->bag->add($type, $message);
// And remove from flash
$this->session->forget($key);
}
}
}
示例6: setLocation
/**
* Sets the location property to the drivers returned location object.
*
* @param string $ip
*/
private function setLocation($ip = '')
{
/*
* Removes location from the session if config option is set
*/
if ($this->localHostForgetLocation()) {
$this->session->forget('location');
}
/*
* Check if the location has already been set in the current session
*/
if ($this->session->has('location')) {
/*
* Set the current driver to the current session location
*/
$this->location = $this->session->get('location');
} else {
/*
* Set the IP
*/
$this->setIp($ip);
/*
* Set the location
*/
$this->location = $this->driver->get($this->ip);
/*
* The locations object property 'error' will be true if an exception has
* occurred trying to grab the location from the driver. Let's
* try retrieving the location from one of our fall-backs
*/
if ($this->location->error) {
$this->location = $this->getLocationFromFallback();
}
$this->session->set('location', $this->location);
}
}
示例7: remove
/**
* Remove a key from storage.
*
* @param string $key The key to remove.
*
* @return null
*/
public function remove($key)
{
$this->session->forget($this->storageKey . '.' . $key);
return null;
}
示例8: clear
/**
* Clear all the cart session data
* @return boolean
*/
public function clear()
{
return $this->session->forget(config('sescart.session_name'));
}