contao/import — Issue #2786: unset() method for the Session class
Author: importer
Created: 2011-11-29 20:14:01+00:00
State: open
Labels: Feature, framework

Developers who use the Session object for storing temporary data currently are not able to delete entries stored in the Session object. Unsetting $GLOBALS['FE_DATA'][...] does not work because of the array copy which the Session object manages.
Therefore, it would be nice to add an unset() method to the Session class.

A possible implementation could look like this (add this to the Session class):

```
/**
* Delete data from the current session
* `param mixed
* `throws Exception
*/
public function unset($strKey)
{
unset($this->arrSession[$strKey]);
}
```

--- _Originally created by vbinsider on January 11th, 2011, at 10:32am (ID 2786)_