Cron scripts & SID

Discussion forum for MOD Writers regarding MOD Development.
Locked
KFCSpike
Registered User
Posts: 26
Joined: Wed May 18, 2005 11:27 am

Cron scripts & SID

Post by KFCSpike » Fri Sep 28, 2007 6:46 pm

Where does phpBB3 get the session ID from?
Does it generate its own?

A cron script I am writing is using

Code: Select all

session_name('cron123');
session_start();
before I call the phpBB3 stuff - I thought that phpBB3 would then use 'cron123' as the SID?

( btw - session.auto_start is off in my php.ini)

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Cron scripts & SID

Post by A_Jelly_Doughnut » Fri Sep 28, 2007 6:51 pm

phpBB does use its own sessions engine. See /includes/session.php for all of the code. session_begin() is the method you would be most interested in.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

KFCSpike
Registered User
Posts: 26
Joined: Wed May 18, 2005 11:27 am

Re: Cron scripts & SID

Post by KFCSpike » Mon Oct 08, 2007 6:30 pm

I've had a good look at session_begin() but still having probs.

My code should work perfectly when run using a browser, but I am running it as a true cron script on the server (as opposed to cron.php in phpBB3).
I'm prolly missing something silly, or maybe its a security thing that stops what I am trying to do.

My script runs once - starts a new session, then logs in using data in the script (a user login).
It saves session_ID and other stuff in my own table.

Next time it runs, it checks my own table stuff against the sessions table to see if already in.
That works.

So - on second run - I now have a session_id and a user_id, how do I utilise session_begin() to use that data instead of it trying to create a new session?

Locked

Return to “[3.0.x] MOD Writers Discussion”