Originally posted by annal
In this script what it does is, it first checks if any session is registered with "if ($SESSION['count']){"
But that won't tell you if the session is registered or not - that will just tell if $SESSION['count'] has a nonzero value (assuming it even exists).
For one thing, you should be using [man]isset[/man] to tell if the variable is there. And for another, unless you start the session first (and unless you're giving $_SESSION['count'] a value some other way) the answer you'll get will always be "no".
now first time when user opens the page, this condition is false and it goes to else step. It unsets the session if there are any and start session with session_start().
But why unset a session if you've already decided there's no session?
And of course, if you don't use session_start() (which you don't if you find $_SESSION['count'] already nonzero), then there won't be any session started.
Start the session. After that look to see if $_SESSION['count'] isset or not - if it isn't then this is a new session (assuming that looking to see if that particular variable is there is enough to tell).
This script is working fine on other comp
Well, you've already checked every configuration, so I guess you haven't configured it to start sessions automatically (which can be set in php.ini, httpd.conf, .htaccess, or in the script itself (where it would be equivalent to session_start()), so I don't know why your script is running on the other computer.