Problems to get session_id

Hello everyone!

I’m working with OCS 2.3.6

Since a couple of days I’m working on a php-file that allows creating an invoice as a pdf-file directly after the conference registration process.

Basically it works. So I can catch the data directly from the MySQL database.

BUT I only can catch the data if I specify it exactly. But to create a bill for the current registrant I need to know what its current session_id is. ( I could use the IP, but if two more users are from the same office, then it wouldn’t work if they have the same IP.)

If I try to write the ID by echo session_id(); I don’t get an answer.

Can anyone give me a hint how to load the session ID or another a specific session parameter?

Thanks $Daniel[‘PHP coder since 1 week’];

PS: I also tried to include Session.inc.php and DataObject.inc.php, but with no result.

Hi @danielbrohm,

It sounds like you’re trying to work outside the OCS environment. It’ll be much easier to interact with OCS if you work within its structures – that’ll mean learning a bit of OCS plugin programming, but there are lots of examples in the codebase and some documentation (OJS is pretty similar to OCS with regards to plugin programming, and there is documentation on that in the OJS Technical Reference).

Regards,
Alec Smecher
Public Knowledge Project Team