I am going to make a j2me application that will connect with php, and it will be restrict with username/pass.
So I will use the session id at the communication of j2me and php.
I want to ask this rather simple.
Session id of server will be unique per user or I have to create an unique session id
With your typical default configuration of php, it will “look for” an existing session id in the http request headers, and if found, reuse it. Otherwise, it will create a new one for you, and send headers to set a cookie with its value.
So yes, the simplified answer is that each user will automatically get thier own unique session id. You might want to make sure the config option session.use_only_cookies is enabled. Otherwise, php will accept session ids in urls and post requests. urls are potentially really bad, because people share links, which might accidentally make them share a session. It’s also much more prone to abuse.
I’m dangerously oversimplifying a complex system.