phpBB way of adding session vars

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
Post Reply
User avatar
MasterZ
Member
Member
Posts: 87
Joined: 07 Jul 2007, 23:46
Real name: Jon
Location: Colorado Springs, CO
Contact:

phpBB way of adding session vars

Post by MasterZ »

If I want to add a new var to the user session just to be stored for a couple of pages, how do I do this?

Currently I'm using $_SESSION['var_name'] but there has to be a phpBB method for doing this. I need to set the value, get the value, and delete the key. Any ideas? I keep searching phpBB docs but no luck so far.
User avatar
Mr. Bond
Member
Member
Posts: 89
Joined: 30 Mar 2008, 20:34
Real name: Bobby
Location: 127.0.0.1

Re: phpBB way of adding session vars

Post by Mr. Bond »

What exactly are you storing?
Twitter • Ohloh • GitHub
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: phpBB way of adding session vars

Post by Obsidian »

To be honest, it's either stored in a db table or cached..
User avatar
MasterZ
Member
Member
Posts: 87
Joined: 07 Jul 2007, 23:46
Real name: Jon
Location: Colorado Springs, CO
Contact:

Re: phpBB way of adding session vars

Post by MasterZ »

Storing some information for the openid authentication before the user gets sent to the openid provider.

So do I need to create a new table to store information then? Or just leave the session_start() in there for now :D

If I do store the information in a new table I need some way to track the session id to make sure I pull out information from the same session that it gets saved to. How do I get the session id?

Or does someone else have a better way to do this?
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: phpBB way of adding session vars

Post by Obsidian »

MasterZ wrote:Storing some information for the openid authentication before the user gets sent to the openid provider.

So do I need to create a new table to store information then? Or just leave the session_start() in there for now :D

If I do store the information in a new table I need some way to track the session id to make sure I pull out information from the same session that it gets saved to. How do I get the session id?

Or does someone else have a better way to do this?


$SID and $_SID are what the session id's are usually in. ;)
User avatar
MasterZ
Member
Member
Posts: 87
Joined: 07 Jul 2007, 23:46
Real name: Jon
Location: Colorado Springs, CO
Contact:

Re: phpBB way of adding session vars

Post by MasterZ »

Since this is going to require an extra table to be created in the DB I think I'm just going to leave it as is for now. If the MOD validation team complains then I will make the new table.
Post Reply