phpBB way of adding session vars

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
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

Postby MasterZ » 13 Jul 2009, 06:32

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.
My MODS:
About Me: -

User avatar
Mr. Bond
Member
Member
Posts: 89
Joined: 30 Mar 2008, 20:34
Real name: Bobby
Location: 127.0.0.1
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: phpBB way of adding session vars

Postby Mr. Bond » 13 Jul 2009, 11:29

What exactly are you storing?
• •

User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: phpBB way of adding session vars

Postby Obsidian » 13 Jul 2009, 13:04

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

Postby MasterZ » 13 Jul 2009, 21:55

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?
My MODS:
About Me: -

User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: phpBB way of adding session vars

Postby Obsidian » 13 Jul 2009, 22:55


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

Postby MasterZ » 14 Jul 2009, 00:02

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.
My MODS:
About Me: -


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “phpBB Development discussion”

Who is online

Users browsing this forum: No registered users and 4 guests