Session strategies for liveCode server

Michael Kann mikekann at yahoo.com
Thu Jan 19 14:47:04 EST 2012


Malte,

You've probably got this running by now, which I've failed to do. But I'll make a suggestion anyway. Perhaps some headers are being sent out before the line "start session". If that is the case then it won't work. Let us know if you untangle it.

Mike

--- On Thu, 1/19/12, Malte Brill <revolution at derbrill.de> wrote:

From: Malte Brill <revolution at derbrill.de>
Subject: Re: Session strategies for liveCode server
To: use-livecode at lists.runrev.com
Date: Thursday, January 19, 2012, 9:02 AM

Anyone, pretty please? Andre, Stephen?

I just do not get it.

I have a login form now and that one calls a liveCode script to validate the user and start a session:

<?lc
local thePostData,tBenuzer,tPasswort,tDisplayForm
put $_POST_RAW into thePostData
replace "&" with cr in thePostData
put URLDecode(thePostData) into thePostData
set the itemDel to "="
put item 2 of line 1 of thepostData into tbenutzer
put item 2 of line 2 of thepostData into tPasswort
if tBenutzer is empty then
    put true into tDisplayForm
end if
if tPasswort is empty then
    put true into tDisplayForm
end if
if tDisplayForm then
    include "login.html"
else
    include "settings.dat"
    include "myhandlers.lc"
    if validateUser(tBenutzer,tPasswort) is true then
        set the sessionID to "mysession"
        set the sessionlifetime to 1000
        start session
        put item 2 of line 1 of thepostData into $_SESSION["myuser"]    
-- works up to here... Validation of the user is correct...
            
        put "<a href='start.lc'>start</a>"
    else
        include "login.html"
    end if
end if
?>

As soon as I click the start link the session appears to have died. $_SESSION is empty. It does not have keys either...


<?lc
if $_SESSION["myuser"] is empty then
 -- always end up here
    include "login.html"
else
put new header "Content-type: text/html; charset=utf-8"
include "doctype.lc"
...
continued
...

I ALWAYS land on the login page though :-( and $_SESSION is ALWAYS empty and does not have any keys at all. What on earth am I doing wrong?
Heeeeeeeeeelp...


_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list