[Klone-users] Session bugs

Mickael Auger mickael.auger at gmail.com
Mon May 5 09:29:55 EDT 2008


Hi,

I use standard KLone 2.1.0 with:
- a standard Linux
- the "kl1_set_status" patch


I want use the session with 'session_set' and 'session_get' method.
But if my variable (const char *) is "" (empty string), the 'session_get'
method returns NULL or "" (random result).


I have this .kl1 page:
============================
<html>
<body>
<%
    session_clean(session);
    session_set(session,"key1","value1");
    session_set(session,"key2","");
    session_set(session,"key3","");
%>
Session_get(key1) :"<%=session_get(session,"key1") %>"<br />
Session_get(key2) :"<%=session_get(session,"key2") %>"<br />
Session_get(key3) :"<%=session_get(session,"key3") %>"<br />
<%
    session_set(session,"key1","value1");
    session_set(session,"key2","");
%>
<br />
Session_get(key1) :"<%=session_get(session,"key1") %>"<br />
Session_get(key2) :"<%=session_get(session,"key2") %>"<br />
Session_get(key3) :"<%=session_get(session,"key3") %>"<br />
</body>
</html>
============================


My web-browser displays:
============================
Session_get(key1) :"value1"
Session_get(key2) :"(null)"
Session_get(key3) :"(null)"

Session_get(key1) :"value1"
Session_get(key2) :""
Session_get(key3) :"(null)"
============================


My "session" file contents:
============================
$ cat /tmp/klone_sess_f2b6c202892332205f14596b7b3ed892_67111434
key1=value1%00
key2=%00
key3=
===================================


I think the '%00' character is your character at the end of value, but I
made other tests and I seen that '%00' character does not appear whenever
after an empty value (or not empty).
I looked at the code quickly and I did not find the error.

Thanks.

-- 
Mickaël AUGER
mickael.auger at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://koanlogic.com/pipermail/klone-users/attachments/20080505/b5a1e202/attachment.html


More information about the klone-users mailing list