[Xerte] Passing SESSION variable

Paul Swanson Paul.Swanson at harlandfs.com
Thu Dec 17 15:49:24 GMT 2009


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



More information about the Xerte mailing list