[SOLVED] Threading or class ? Concurrent sessions

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
samuel.vannesteBUSGvXT
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 43
Joined: Wed Sep 19, 2012 6:32 pm
Location: Versailles, France

[SOLVED] Threading or class ? Concurrent sessions

Post by samuel.vannesteBUSGvXT » Thu Jun 26, 2014 8:33 pm

Hello,

Please, could you point me to some information about concurrent sessions ? I previously had no opportunity to develop such softs and I remember from school that I'll had to use some classes or threading. Am I wrong or is it naturally handled by LC server ?

For example, if I create some code to access a MySQL database (which is already handling concurrent sessions) would I have to use only LC sessions or would it be a risk for the information dilution ?

Many thanks :)
Last edited by samuel.vannesteBUSGvXT on Fri Jun 27, 2014 10:25 am, edited 1 time in total.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 928
Joined: Fri Aug 15, 2008 7:15 am

Re: Threading or class ? Concurrent sessions

Post by bangkok » Fri Jun 27, 2014 8:09 am

I'm not sure to understand your question.

LiveCode manages perfectly well $_SESSION and $_COOKIE.

And regarding "concurrent sessions" with a MySQL database, then again there is no problem : each user who uses a LC server script will be granted access to the database through a different ID.

Then after : what happens if 2 users want to update the same record ? Here it's pure SQL management and architecture, with locks, transactions, rollbacks etc.

samuel.vannesteBUSGvXT
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 43
Joined: Wed Sep 19, 2012 6:32 pm
Location: Versailles, France

Re: Threading or class ? Concurrent sessions

Post by samuel.vannesteBUSGvXT » Fri Jun 27, 2014 10:25 am

Hello Bangkok,

Thanks a lot for having taken the time to reply. It's now clearer for me.
I asked the question because when I made some tests with the sessions, I was able to access the same session using two different browsers from the same IP. So, I will have to check my code to fix this using the cookie.

Thanks again :D

Post Reply

Return to “CGIs and the Server”