Livecode Server Sessions

Simon Smith hello at simonsmith.co
Sun Jun 1 08:37:11 EDT 2014


Hi Igor

Sessions on LiveCode are pretty easy to use and work in a similar fashion
to other languages like php. You just need to ensure that you use the stop
session command aswell somewhere in the scripts., as that is when
everything gets written to the session variable.

e.g. Script 1:

<?lc
start session
put "test" into $_SESSION["myVar"]
put quote & $_SESSION["myVar"] & quote && "saved to session variable"
stop session
?>

Script 2 can now access the saved session variable:

<?lc
start session
put quote & $_SESSION["myVar"] & quote && "read from session variable"
stop session
?>


There are a couple of other commands for sessions that add some more
flexibility that you should be able to find in the dictionary.

   - delete session
   - sessionCookieName
   - sessionID
   - sessionLivetime
   - sessionName
   - sessionSavePath


Hope this helps.
Simon




On Sun, Jun 1, 2014 at 12:33 PM, Igor de Oliveira Couto <igor at semperuna.com>
wrote:

> On 1 Jun 2014, at 8:08 pm, Dave Kilroy <dave at applicationinsight.com>
> wrote:
>
> > Hi Igor
> >
> > I don't know of any LC session tutorials other than the one you
> mentioned -
> > but I'm wondering if the user guide page on RevIgniter's Session Library
> > might be of interest an may provide some pointers?
> > http://revigniter.com/userGuide/libraries/sessions.html
>
> It seems that RevIgniter uses its own session handling scheme, rather than
> using LiveCode’s “$_SESSION” - they even provide instructions on how to
> save session data to a database, if desired.
>
> Neat, but I was wondering whether the built-in $_SESSION would be enough?…
>
>
> --
> Igor Couto
> Sydney, Australia
>
> _______________________________________________
> 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
>



-- 

*Simon Smith*
*seo, online marketing, web development*

w. http://www.simonsmith.co
m. +27 83 306 7862



More information about the use-livecode mailing list