I want to generate a session ID. This unique sessionId represents some different data for every different user.
My code till now:
onclick and onload of a page I call a function
create_session_id();
function create_session_id() { // This function sends a string to a PHP page using ajax post. }
On my PHP page, I receive this data and then insert it:
session_start(); $a = session_id(); $object->insert_sessionid($a);
My Question
Is it possible to use only session_start()
(no session_id()
) and store some unique session ID value that I can use later when I fetch data and throw data to my web page. I don’t want any clicks to register sessionid. It should happen on page load and without any function create_session_id()
.
I am thinking to bring some cookies in to the picture.
Note: My website doesn’t allow login.