$_SESSION fails on LC Server 7.1.3-rc-1

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

$_SESSION fails on LC Server 7.1.3-rc-1

Post by dave.kilroy » Mon Mar 14, 2016 12:46 pm

Just a quick note to anyone who might be experiencing weirdness in their .lc scripts ... it's not you it's LiveCode 7 not managing $_SESSION properly

This also impacts on revIgniter’s Session Library. My workaround for this bug is to target LiveCode Server version 6

http://quality.livecode.com/show_bug.cgi?id=14452 Can any of you confirm and if so add to the bug report?

Dave
"...this is not the code you are looking for..."

carlos
Posts: 5
Joined: Tue May 05, 2009 11:01 am
Location: Gold Coast, Australia

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by carlos » Fri Mar 18, 2016 8:21 am

I've reported a bug (17160) where $_POST is not being handled correctly when the .lc page uses enctype=multipart/form-data
Not sure if this is related in some way to your issue or not, but it impacts websites that use revigniter and upload files

When using enctype=multipart/form-data on the form tag, livecode server 7.1 doesn't think $_POST is an array.
I first noticed the problem in a website that uses revigniter, where I was getting "Disallowed key characters" returned to the browser.

Carl

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by dave.kilroy » Fri Mar 18, 2016 11:52 am

Hi Carl

First an update on $_SESSION and revIgniter

On the revIgniter mail list (http://lists.livecodejournal.com/privat ... ournal.com), Ralf Bitter explained that revIgniter has it's own (proprietary) session management and is not dependent on the engine's way to handle sessions. However the revigniter websites I had that were failing were running old copies of revIgniter (pre 1.6.17) which relied on the binary string returned in arrayEncode(). In LiveCode 7 this was changed and revIgniter 1.6.17 onwards handles it. So all reasonably modern versions of revigniter should be fine with LC Server 7

As regards the $_SESSION bug, it looks like Fraser has fixed this for the next build - see http://quality.livecode.com/show_bug.cgi?id=14452 which now has "Awaiting Merge" status.

Returning to your $_POST bug - what version of revigniter are you running? It may be worth updating it :)

Kind regards

Dave
"...this is not the code you are looking for..."

carlos
Posts: 5
Joined: Tue May 05, 2009 11:01 am
Location: Gold Coast, Australia

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by carlos » Fri Mar 18, 2016 12:40 pm

Hi Dave,

Thanks for the update. I'm running revigniter 1.6.24 and 1.7 on different sites. They both have the Disallowed key characters problem when I try to upload a file. This didn't happen before the migration to the new server.

I don't think it is actually a revigniter problem. I've reproduced the $_POST issue without using revigniter. I attached a small test file to bug 17160 which demonstrates on jasmine (that's where my hosting account is) that $_POST is not an array if I use enctype=multipart/form-data on the form tag a .lc file. I would be interested to know if you are able to reproduce the problem on another server running livecode server 7.1

Kind Regards,
Carl

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by dave.kilroy » Fri Mar 18, 2016 1:01 pm

Hi Carl

No it's not just on-rev.

When I was researching whether my $_SESSION bug affected revigniter, I created two subdomains on my hostm account, one targeted at LC server 6 and the other LC server 7. I uploaded your test file to the following urls and you can see that your $_POST fails on LC server 7 but is fine on LC server 6

http://testlc6.appinsight.biz/upload-test1.lc
http://testlc7.appinsight.biz/upload-test1.lc

Dave
"...this is not the code you are looking for..."

rabit
Posts: 40
Joined: Wed May 31, 2006 8:30 am

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by rabit » Fri Mar 18, 2016 4:45 pm

@Carl I can confirm your finding. There is definitely an issue
with multipart/form-data forms. In this respect I tweaked revIgniter code
and pushed it to GitHub. Now as long as as your form contains solely
input fields of type "file" uploads should work.
Nonetheless I hope that this engine issue will be addressed soon.

Ralf

carlos
Posts: 5
Joined: Tue May 05, 2009 11:01 am
Location: Gold Coast, Australia

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by carlos » Sat Mar 19, 2016 7:32 am

Many thanks Dave and Ralf.

Carl

andyh1234
Posts: 442
Joined: Mon Aug 13, 2007 4:44 pm
Location: Eccles UK
Contact:

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by andyh1234 » Thu Mar 24, 2016 2:06 pm

Thanks for putting this up, I was tearing my hair out as I had just moved a domain from another host to diesel and I could not get the sessions to work!

Hop do you go about getting the .lc files to be parsed by the 6.5 version of livecode? I have downloaded and put the 6.5 version in the cgi-bin, extracted it with the cpanel file manager and checked all the permissions which are good, then added the lines below to the .htaccess file for the domain but it still goes to the main server livecode and reports 7.1.0.

Any ideas on what I am doing wrong?

Thanks

Andy

Code: Select all

RewriteOptions inherit
Options -Indexes +ExecCGI
AddHandler livecode-script .lc
Action livecode-script /cgi-bin/livecode-server

rabit
Posts: 40
Joined: Wed May 31, 2006 8:30 am

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by rabit » Thu Mar 24, 2016 3:28 pm

@Andy actually only line 3 to 4 are needed on "diesel".
If this still does not work I suspect the path
to the engine might be wrong.


Ralf

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: $_SESSION fails on LC Server 7.1.3-rc-1

Post by dave.kilroy » Thu Mar 24, 2016 4:21 pm

Hi Andy

Following on from what Ralf says, in the past using "livecode-community-server" instead of "livecode-server" has made the difference (when using the community version)

Dave
"...this is not the code you are looking for..."

Post Reply

Return to “CGIs and the Server”