Aura.Session icon indicating copy to clipboard operation
Aura.Session copied to clipboard

Feature Request - getOnce?

Open OwenMelbz opened this issue 8 years ago • 1 comments

Is there the possibility we could get a getOnce function as we've dealt with a few applications that we want to use setFlash for - but sometimes there are redirects going on, which mean the flash is lost.

What we find ourselves doing is

$previousConfiguration = Su::$session->get('previousConfiguration', false);

if( $previousConfiguration ){
    Su::$session->set('previousConfiguration', false);
}

What would be great is if this functionality could be added by default, e.g

$session->getOnce('previousConfiguration', false);`

Which then unsets the value after its been used?

Many thanks for your time and effort in the project :)

OwenMelbz avatar Aug 25 '16 12:08 OwenMelbz

but sometimes there are redirects going on, which mean the flash is lost

Does keepFlash method https://github.com/auraphp/Aura.Session#keeping-and-clearing-flash-values helps in that case?

harikt avatar Aug 25 '16 16:08 harikt

Closing this issue. This can be implemented outside also.

harikt avatar Sep 14 '23 04:09 harikt