9three Posted March 5, 2009 Share Posted March 5, 2009 I created a class that holds all my session handling for me. I'm having an issue where the parameters for the session is not being stored. The value however, is being returned correctly. public static function setSession($name, $id) { $_SESSION['$name'] = $id; } So when I test this require('session.class.php'); session::Start(); session::setSession(test, 1); foreach ($_SESSION as $name => $value) { echo $name; echo $value; } it out puts $name and 1. The correct values should be test, and 1. Link to comment https://forums.phpfreaks.com/topic/148041-solved-static-functions-and-sessions/ Share on other sites More sharing options...
WolfRage Posted March 5, 2009 Share Posted March 5, 2009 <?php public static function setSession($name, $id) { $_SESSION[$name] = $id; } ?> Link to comment https://forums.phpfreaks.com/topic/148041-solved-static-functions-and-sessions/#findComment-777058 Share on other sites More sharing options...
9three Posted March 5, 2009 Author Share Posted March 5, 2009 You sir, are correct! I should have picked that up sooner Link to comment https://forums.phpfreaks.com/topic/148041-solved-static-functions-and-sessions/#findComment-777064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.