I have simple visitor counter written in PHP.
I want to use PHP session id as field to determine unique visitor on my page.
I store PHP session ID in database and I want to use "group by" to count unique users.
Question(s)
Is this possible to set very long session lifetime (by very long i mean 1 week or 1 month)?
I feel that im doing it wrong. Is this bad idea?
How can I set this (in PHP)?
If you have unlimited storage, yes. Otherwise, no.
Why do you need a group by? Unique session id = unique visitor (roughly)
If you want to do stats tracking use special software, like the free Google Analytics or one of the many competitors. They take care of all the hard things like tracking unique visitors and filtering bots.