My example:
I have a website (Gee, something unique every day!). It has the ability to change between seven themes (not including an additional theme that is "Printer Friendly") and also to change between two languages (English and Deutsch). Now, the old way I did it was without Sessions and I used conditionals with isset functions to detect the theme, but they also detected it via Cookies ($theme = |cookie|) or they'd automatically set a cookie (or in the case of languages, redirect to the index page to have the user set their own language).
Now, if I am going to kill off all the cookies (*tear*, i love cookies, they taste good), what do I have to do to implement Sessions to do the exact same thing. I kept screwing up the code with stuff like this:
Code: Select all
if(isset($variable)) {
$variable = $_SESSION['variable']
} else {
$variable = "yadayadayada"
}