Alternative to Sessions within WordPress
Nobody told me that WordPress total jacks up the globals making it near impossible for you to register sessions within WordPress. I tried a couple hacks to enable it via functions.php, I even went as far as ripping out code from the core to get it to work!
In a Google search I stumbled upon the Transient API – oh lordy, yes!
So custom sessions aren’t working for me, transients are the next best thing, they are super easy too!
[php]
## STORE TEXT
set_transient($myvar, ‘text I want to store’, 60*60*12);
## RETRIEVE TEXT
echo get_transient($myvar);
## DELETE THE TEXT
delete_transient($myvar);
[/php]
All my troubles seem so far away!