<HTML dir=ltr><HEAD><TITLE>RE: [Xerte] Passing SESSION variable</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6001.18349" name=GENERATOR>
<STYLE>
<!--
font-face
        {font-family:"Cambria Math";}
font-face
        {font-family:Calibri;}
font-face
        {font-family:Tahoma;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {
        color:purple;
        text-decoration:underline;}
p
        {
        margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {
        margin-right:0in;
        margin-left:0in;
        font-size:10.0pt;
        font-family:"Times New Roman","serif";}
span.emailstyle18
        {
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle20
        {
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {
        font-size:10.0pt;}
div.Section1
        {page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV id=idOWAReplyText90887 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Its ok, you have moodle and you're awake, so you might find an answer first.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Well it seems there must be an admin page, where you can set moodle session options</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Paul Swanson<BR><B>Sent:</B> Thu 17/12/2009 23:55<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Passing SESSION variable<BR></FONT><BR></DIV>
<DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Patrick,</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Found this in \moodle\admin\settings\server.php:</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">// "sessionhandling" settingpage</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">$temp = new admin_settingpage('sessionhandling', get_string('sessionhandling', 'admin'));</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">$temp->add(new admin_setting_configcheckbox('dbsessions', get_string('dbsessions', 'admin'), get_string('configdbsessions', 'admin'), 0));</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">$temp->add(new admin_setting_configselect('sessiontimeout', get_string('sessiontimeout', 'admin'), get_string('configsessiontimeout', 'admin'), 7200, array(14400 => get_string('numhours', '', 4),</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 10800 => get_string('numhours', '', 3),</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 7200 => get_string('numhours', '', 2),</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 5400 => get_string('numhours', '', '1.5'),</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 3600 => get_string('numminutes', '', 60),</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 2700 => get_string('numminutes', '', 45),</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 1800 => get_string('numminutes', '', 30),</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 900 => get_string('numminutes', '', 15),</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 300 => get_string('numminutes', '', 5))));</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">$temp->add(new admin_setting_configtext('sessioncookie', get_string('sessioncookie', 'admin'), get_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">$temp->add(new admin_setting_configtext('sessioncookiepath', get_string('sessioncookiepath', 'admin'), get_string('configsessioncookiepath', 'admin'), '/', PARAM_LOCALURL));</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">$ADMIN->add('server', $temp, 50);</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Not sure what to make of it, though. </SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Just to clarify, it’s Ken Scott who is having the problem. I’m not using moodle, either. Just trying to help troubleshoot.</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Paul</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<DIV>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Patrick Lockley<BR><B>Sent:</B> Thursday, December 17, 2009 3:33 PM<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Passing SESSION variable</SPAN></P></DIV></DIV>
<P class=MsoNormal> </P>
<DIV id=idOWAReplyText71999>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">possibly</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">i have no moodle, but maybe it has its own session handlers set.</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">I think the function is set_session_handler - have a look in the code for that.</SPAN></P></DIV></DIV>
<DIV>
<P class=MsoNormal> </P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center>
<HR align=center width="100%" SIZE=2>
</DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> xerte-bounces@lists.nottingham.ac.uk on behalf of Paul Swanson<BR><B>Sent:</B> Thu 17/12/2009 22:43<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Passing SESSION variable</SPAN></P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">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? </SPAN></P>
<P class=MsoNormal> </P>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<DIV>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Patrick Lockley<BR><B>Sent:</B> Thursday, December 17, 2009 2:22 PM<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Passing SESSION variable</SPAN></P></DIV></DIV>
<P class=MsoNormal> </P>
<DIV id=idOWAReplyText50369>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">edit.php has a session start line in, believe me, i know, it couldn't work without one.</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">When i tried to integrate with moodle it worked up until edit, and i could never get edit to to work.</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">You can try adding session_start(); print_r($_SESSION); at the top of the code, but when i did that i still got nothing.</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">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.</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">I would hunt for a session_start function call in the moodle code.</SPAN></P></DIV></DIV>
<DIV>
<P class=MsoNormal> </P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center>
<HR align=center width="100%" SIZE=2>
</DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> xerte-bounces@lists.nottingham.ac.uk on behalf of Ken Scott<BR><B>Sent:</B> Thu 17/12/2009 16:13<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Passing SESSION variable</SPAN></P></DIV>
<DIV>
<P><SPAN style="FONT-SIZE: 10pt">Many thanks Paul - I will try that.<BR><BR>Ken Scott<BR>e-learning advisor<BR>JISC RSC YH<BR>07966 754040<BR><BR>RSCs – Stimulating and Supporting Innovation in Learning<BR><BR>Know someone making an impact on learning through technology?<BR>Nominate a colleague for an Evolution Award! Deadline: 15 Jan 2010.<BR><BR>Visit www.rsc-yh.ac.uk/evolution for details<BR><BR><BR>________________________________________<BR>From: xerte-bounces@lists.nottingham.ac.uk [xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Paul Swanson [Paul.Swanson@harlandfs.com]<BR>Sent: 17 December 2009 15:49<BR>To: Xerte discussion list<BR>Subject: RE: [Xerte] Passing SESSION variable<BR><BR>For any PHP script to have access to session variables, you must first<BR>invoke the session handler. Open the php script in question and look for<BR>session_start(); If it is not there, add it near the top of the script,<BR>before any attempt to read or set session variables. Once you have that,<BR>you can see what session variables are available by using<BR>print_r($_SESSION);<BR><BR>As Dave mentioned, you must accept cookies for session variables to<BR>work.<BR><BR>It sounds like your PHP is set up to not show errors. In those<BR>situations a fatal error will result in a blank page. During<BR>development, it's really nice to know what errors may be happening, so<BR>you may want to override the php.ini settings while you are<BR>troubleshooting. You can do this on a script-by-script basis with the<BR>following:<BR><BR>ini_set('display_errors', 1);<BR>error_reporting(E_ALL);<BR><BR>You will want to comment those lines out once you've got it working.<BR><BR>Hope that helps.<BR><BR>Paul<BR><BR><BR>> -----Original Message-----<BR>> From: xerte-bounces@lists.nottingham.ac.uk [<A href="mailto:xerte-">mailto:xerte-</A><BR>> bounces@lists.nottingham.ac.uk] On Behalf Of Ken Scott<BR>> Sent: Thursday, December 17, 2009 6:35 AM<BR>> To: Xerte discussion list<BR>> Subject: RE: [Xerte] Passing SESSION variable<BR>><BR>> Thanks, no difference<BR>><BR>> Ken Scott<BR>> e-learning advisor<BR>> JISC RSC YH<BR>> 07966 754040<BR>><BR>> RSCs - Stimulating and Supporting Innovation in Learning<BR>><BR>> Know someone making an impact on learning through technology?<BR>> Nominate a colleague for an Evolution Award! Deadline: 15 Jan 2010.<BR>><BR>> Visit www.rsc-yh.ac.uk/evolution for details<BR>><BR>><BR>> ________________________________________<BR>> From: xerte-bounces@lists.nottingham.ac.uk [xerte-<BR>> bounces@lists.nottingham.ac.uk] On Behalf Of Dave Burnett<BR>> [d_b_burnett@hotmail.com]<BR>> Sent: 17 December 2009 14:10<BR>> To: Xerte list<BR>> Subject: RE: [Xerte] Passing SESSION variable<BR>><BR>> Try explicitly allowing cookies from the domain you are serving from.<BR>><BR>> > From: k.scott@leeds.ac.uk<BR>> > To: xerte@lists.nottingham.ac.uk<BR>> > Date: Thu, 17 Dec 2009 14:02:08 +0000<BR>> > Subject: [Xerte] Passing SESSION variable<BR>> ><BR>> > Wonder if anyone can help?<BR>> ><BR>> > I a using the moodle integration patch, and logins in fine. However<BR>> when I try to edit or preview a project I get a blank page. I have<BR>> traced execution and edit.php doesn't seem to have any of the session<BR>> variables available to it - it therefore tries to select from the<BR>table<BR>> with a userid of null.<BR>> ><BR>> > How should the session variables be passed? Not a PHP expert and it<BR>> is not obvious to me!<BR>> ><BR>> > Many thanks<BR>> ><BR>> ><BR>> > Ken Scott<BR>> > e-learning advisor<BR>> > JISC RSC YH<BR>> > 07966 754040<BR><BR>_______________________________________________<BR>Xerte mailing list<BR>Xerte@lists.nottingham.ac.uk<BR><A href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte">http://lists.nottingham.ac.uk/mailman/listinfo/xerte</A><BR>_______________________________________________<BR>Xerte mailing list<BR>Xerte@lists.nottingham.ac.uk<BR><A href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte">http://lists.nottingham.ac.uk/mailman/listinfo/xerte</A></SPAN></P></DIV></DIV></DIV></DIV></DIV></DIV></BODY></HTML>