Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using constant 1

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
In my page ( I am adding a hit logging routing where I can track pages hit by users and time spent on each page.

Every page is pushed through a single script (index.php) and other scripts are included as needed to process requests.

I am successfully creating the page hit record but I notice that one bit of data is missing, the session ID. This ID is crucial as it will be the key to group/sort the data I am collecting.

I am using
Code:
$ssid = constant("SID");
to dump the session ID on a variable ... The value is not always blank. When the session is first started, I get data but not there after.

What is up with this?

Thank you all in advance for you help!

Regards,



--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
i don't think that SID will give you what you want. according to the manual SID returns EITHER (i) a string equal to "session_name=session_value"; OR (ii) a blank string.

it will return a blank string if the session ID has been set in a cookie. the first is used for trans-sid session referencing. link

if you just want to get the session_id in a variable use this
Code:
$ssid = session_id();
 
and right you are ... With the suggested change, I am getting what I need ...

Thanks!


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top