This is more of a reminder to myself, than anything else.
- WordPress does not use sessions as of now. They do everything via cookies.
- Before using
$_SESSIONvariable in PHP, one should havesession_start()done. Read more about PHP sessions. In WordPress, the best place to have this is at the top of the header.php. - Another page load is needed after
setcookie()call to be able to use the$_COOKIEvariable. Read more about PHP cookies.
That’s all for now. Hopefully, I’ll spend less time bumping my head over this next time.
2 responses so far ↓
1
Timur Asaliev
// Mar 7, 2007 at 12:34 pm
Leonid, the funny part is that I was bumping my head on Monday and Tuesday because of cookies and sessions. ROFL, this is such a crazy world!
2
Leonid Mamchenkov
// Mar 7, 2007 at 12:50 pm
LOL.. with all the things people can be doing - they stick to the same old stuff.
Leave a Comment