Hi,<br><br>I use the &quot;session&quot; global variable (with &quot;session_set() function) to memorize information of connected user and I use the &quot;session_get()&quot; function to read this information.<br>I use the &quot;hook&quot; functions (hooks_setup, ...) but I wish to use the &quot;session&quot; global variable in my definition of &quot;hook_request()&quot; to trace the connected user&#39;s name who make the request.<br>
<br>However I have this compilation error :<br>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>fctscommunes.c: In function `server_request&#39;:<br>fctscommunes.c:23: `session&#39; undeclared (first use in this function)<br>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br><br>Have you a solution, please (specifique include ...) ?<br><br>Here an abstract of my source code (&quot;fctcommunes.c&quot;) :<br>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>
#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;klone/klone.h&gt;<br>#include &lt;klone/context.h&gt;<br><br>int server_init(void)<br>{<br>&nbsp; printf(&quot;KLone launched\n&quot;);<br>&nbsp; return 0;<br>}<br>
int server_term(void)<br>{<br>&nbsp; printf(&quot;KLone closed\n&quot;);<br>&nbsp; return 0;<br>}<br>int server_request(void)<br>{<br>&nbsp; printf(&quot;KLone accessed by %s\n&quot;, session_get(session,&quot;username&quot;));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // line 23<br>
&nbsp; return 0;<br>}<br><br>void hooks_setup(void)<br>{<br>&nbsp; hook_server_init(server_init);<br>&nbsp; hook_server_term(server_term);<br>&nbsp; hook_request(server_request);<br>}<br>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>
<br>Thanks<br clear="all"><br>-- <br>My conf :<br>- KLone 2.1.1<br>- uClinux<br><br>Mickaël AUGER<br><br>