[Xerte] Passing SESSION variable

Paul Swanson Paul.Swanson at harlandfs.com
Thu Dec 17 23:55:42 GMT 2009


Patrick,

 

Found this in \moodle\admin\settings\server.php:

 

// "sessionhandling" settingpage

$temp = new admin_settingpage('sessionhandling',
get_string('sessionhandling', 'admin'));

$temp->add(new admin_setting_configcheckbox('dbsessions',
get_string('dbsessions', 'admin'), get_string('configdbsessions',
'admin'), 0));

$temp->add(new admin_setting_configselect('sessiontimeout',
get_string('sessiontimeout', 'admin'),
get_string('configsessiontimeout', 'admin'), 7200, array(14400 =>
get_string('numhours', '', 4),

 
10800 => get_string('numhours', '', 3),

 
7200 => get_string('numhours', '', 2),

 
5400 => get_string('numhours', '', '1.5'),

 
3600 => get_string('numminutes', '', 60),

 
2700 => get_string('numminutes', '', 45),

 
1800 => get_string('numminutes', '', 30),

 
900 => get_string('numminutes', '', 15),

 
300 => get_string('numminutes', '', 5))));

$temp->add(new admin_setting_configtext('sessioncookie',
get_string('sessioncookie', 'admin'), get_string('configsessioncookie',
'admin'), '', PARAM_ALPHANUM));

$temp->add(new admin_setting_configtext('sessioncookiepath',
get_string('sessioncookiepath', 'admin'),
get_string('configsessioncookiepath', 'admin'), '/', PARAM_LOCALURL));

$ADMIN->add('server', $temp, 50);

 

Not sure what to make of it, though. 

 

Just to clarify, it's Ken Scott who is having the problem. I'm not using
moodle, either. Just trying to help troubleshoot.

 

Paul

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patrick
Lockley
Sent: Thursday, December 17, 2009 3:33 PM
To: Xerte discussion list
Subject: RE: [Xerte] Passing SESSION variable

 

possibly

 

i have no moodle, but maybe it has its own session handlers set.

 

I think the function is set_session_handler - have a look in the code
for that.

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk on behalf of Paul Swanson
Sent: Thu 17/12/2009 22:43
To: Xerte discussion list
Subject: RE: [Xerte] Passing SESSION variable

Just poked around on my system where I have an old copy of moodle
installed. I'm using Xerte stand-alone, not XOT, and we aren't using
moodle. Anyway, I found a folder off my root named moodledata, and in
there is a folder named sessions where moodle seems to be storing it's
session cookies. Could the problem be that moodle uses its own folder
for sessions, rather than the folder specified in php.ini? 

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patrick
Lockley
Sent: Thursday, December 17, 2009 2:22 PM
To: Xerte discussion list
Subject: RE: [Xerte] Passing SESSION variable

 

edit.php has a session start line in, believe me, i know, it couldn't
work without one.

 

When i tried to integrate with moodle it worked up until edit, and i
could never get edit to to work.

 

You can try adding session_start(); print_r($_SESSION); at the top of
the code, but when i did that i still got nothing.

 

I don't know enough about moodle, but i assumed when moodle runs
session_start, is passes through some parameters to set itself up, or
the way moodle passes session ids is different to toolkits.

 

I would hunt for a session_start function call in the moodle code.

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk on behalf of Ken Scott
Sent: Thu 17/12/2009 16:13
To: Xerte discussion list
Subject: RE: [Xerte] Passing SESSION variable

Many thanks Paul - I will try that.

Ken Scott
e-learning advisor
JISC RSC YH
07966 754040

RSCs - Stimulating and Supporting Innovation in Learning

Know someone making an impact on learning through technology?
Nominate a colleague for an Evolution Award!  Deadline: 15 Jan 2010.

Visit www.rsc-yh.ac.uk/evolution for details


________________________________________
From: xerte-bounces at lists.nottingham.ac.uk
[xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Swanson
[Paul.Swanson at harlandfs.com]
Sent: 17 December 2009 15:49
To: Xerte discussion list
Subject: RE: [Xerte] Passing SESSION variable

For any PHP script to have access to session variables, you must first
invoke the session handler. Open the php script in question and look for
session_start(); If it is not there, add it near the top of the script,
before any attempt to read or set session variables. Once you have that,
you can see what session variables are available by using
print_r($_SESSION);

As Dave mentioned, you must accept cookies for session variables to
work.

It sounds like your PHP is set up to not show errors. In those
situations a fatal error will result in a blank page. During
development, it's really nice to know what errors may be happening, so
you may want to override the php.ini settings while you are
troubleshooting. You can do this on a script-by-script basis with the
following:

ini_set('display_errors', 1);
error_reporting(E_ALL);

You will want to comment those lines out once you've got it working.

Hope that helps.

Paul


> -----Original Message-----
> From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-
> bounces at lists.nottingham.ac.uk] On Behalf Of Ken Scott
> Sent: Thursday, December 17, 2009 6:35 AM
> To: Xerte discussion list
> Subject: RE: [Xerte] Passing SESSION variable
>
> Thanks, no difference
>
> Ken Scott
> e-learning advisor
> JISC RSC YH
> 07966 754040
>
> RSCs - Stimulating and Supporting Innovation in Learning
>
> Know someone making an impact on learning through technology?
> Nominate a colleague for an Evolution Award!  Deadline: 15 Jan 2010.
>
> Visit www.rsc-yh.ac.uk/evolution for details
>
>
> ________________________________________
> From: xerte-bounces at lists.nottingham.ac.uk [xerte-
> bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
> [d_b_burnett at hotmail.com]
> Sent: 17 December 2009 14:10
> To: Xerte list
> Subject: RE: [Xerte] Passing SESSION variable
>
> Try  explicitly allowing cookies from the domain you are serving from.
>
> > From: k.scott at leeds.ac.uk
> > To: xerte at lists.nottingham.ac.uk
> > Date: Thu, 17 Dec 2009 14:02:08 +0000
> > Subject: [Xerte] Passing SESSION variable
> >
> > Wonder if anyone can help?
> >
> > I a using the moodle integration patch, and logins in fine. However
> when I try to edit or preview a project I get a blank page. I have
> traced execution and edit.php doesn't seem to have any of the session
> variables available to it - it therefore tries to select from the
table
> with a userid of null.
> >
> > How should the session variables be passed? Not a PHP expert and it
> is not obvious to me!
> >
> > Many thanks
> >
> >
> > Ken Scott
> > e-learning advisor
> > JISC RSC YH
> > 07966 754040

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20091217/22a200d8/attachment.html


More information about the Xerte mailing list