Is there an easy way to tell if a session has been started?
Say if you wanted to display a different bit of copy or image depending on the status of a user...
Cheers,
Tony.
A session is only started when you call session_start(), so you already know when a session is started.
Thanks Vincent,
'I' know I have started a session 🙂 How can i make the 'script' know - I want to display a different colour icon for people who have placed things in their basket. I want to do something like:
if (isset($session_id)) { print"this image"; } else { print"another image"; }
If possible...
Cheers.
So you don't want to know wether or not a session is started, you want to know wether some variable in the session has been set.
Why don't you just check to see if any items are in the cart?
session_id() will return the current session number if there is one, and zero if there is no session active.
-t
Cheers Tim - that was what I wanted know...
Thanks.