Session Control [on/off]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Session Control [on/off]

Post by infolock »

Is there a method to determine if sticky session control has been turned on or off? This is the first time i've run into this issue, and am wondering if there is a quick check I can make to determine if it's turned on or off.

Currently, I'm doing something like this:

Code: Select all

session_start();
if(isset($_SESSION)) {
  $this->session =& $_SESSION;
} else {
  $this->session = array();
}
but i'm unsure if this is the best method or not.

if anyone could shed some light on this that would be great. thanks.


[edit]

Let me rephrase that. I am wanting to determine if session-support has been enabled in the php config file or not on the fly.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

That seems good.. maybe ini_get()? Not sure what you would "get" from the ini file though. =/
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

Yeah, I could do that, only I don't want to as I'm already using ini_set to point to my own personal ini file for some path settings. Would be my last alternative. Just wondering if there was an alternative, or if what I wrote above is the alternative.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

get_loaded_extensions() might give you a hint.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

Thanks
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Everah in the Ode To Feyd Topic wrote:30. Hundreds of PHP built-in functions, not known to you or I, are anxiously waiting for Feyd to tell someone: "You might want to look at...".
:lol:
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply