Setting SESSION variables.
-
<?php
/*
* Plugin Name: PGC_PDP_setcookie
* Plugin URI: http://www.quovadimus.net
* Descripton: This plugin bridges between WordPress and PGC PDP
* Author: Dave Johnson
* Version: 0.1
* Author URI: saywhat
*License: GPLv2 or laterI’m trying to write a plugin that accesses an external data bass and set a session variable from data in that database. All works except setting the session variable. I created a stripped down version that should start the session and set a single variable @ in it. However even that does not work. The session is started, the PHPSESSID cookie is created, the cookie value matches. But the variable is not set. Stripped down version is as follows:
Thanks
*/add_action(‘init’, ‘PGCstartSession’, 1);
Function PGCstartSession(){ if (!isset($_SESSION)) {
$timeout = 3600;
session_set_cookie_params ( $timeout ,’/’, ‘.pgcsoaring.org’);
session_start();
$_SESSION[“var1”] = ‘dummy’;
}
}
The topic ‘Setting SESSION variables.’ is closed to new replies.