ihtus
ihtus

Reputation: 2811

Get Session value based on its ID

I am implementing SWFUpload into Joomla. I am passing the Session ID to the server - session_id() - and on the server side need to retrieve $_SESSION value for that specific ID sent by swfupload.

My question is how to get $_SESSION value based on session ID?

Upvotes: 0

Views: 3417

Answers (2)

gen_Eric
gen_Eric

Reputation: 227310

To set the session ID, pass it to session_id before calling session_start.

$sessionID = "abc123";  // or from $_POST or whatever

session_id($sessionID);
session_start();

// $_SESSION will now contain the values from the given session ID

Upvotes: 4

Toby Allen
Toby Allen

Reputation: 11221

I think what you need to do is to store the relevant information somewhere other than the $_SESSION variable, since by its nature its supposed to be only available for the particular client to whom the session applies!

If you store the UserID or whatever in the DB and then use the SessionID as a key you can look up whatever info you need for your script

Hope this is helpful.

Upvotes: 0

Related Questions