I'd vote for letting PHP do the session management. That way all of that
load is on the server (which is made for handling it). Then you can, at any
time, reference a session with AJAX.

It's what I do on my cookbook site.

<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Stephen Woodbridge
Sent: Tuesday, December 19, 2006 3:16 PM
To: jQuery Discussion.
Subject: Re: [jQuery] jquery session handling versus PHP


Kim Johnson wrote:
> Currently I use PHP's built in session functions to
> handle ensuring users are logged in, etc. It doesn't
> work correctly a small percentage of the time, but is
> robust as far as being able to use the $_SESSION array
> and other such things. Now that I'm starting to use a
> bunch of jquery stuff, I'm interested in knowing if
> there's anything comparable. I haaaaate
> troubleshooting why sessions aren't working so I'd
> like something more reliable.
>
> I noticed there's a cookie plugin for jquery but it
> seems to just do basic things. Is there anything
> comparable to PHP's system in jquery, or should I just
> stick with PHP?

Sessions are in large part because HTTP applications used to be
stateless and it was the only way to write an application that had flow.
In that world the application lived on the server and the browser was
just a presentation window. With Javascript and AJAX the application can
move into the browser so all the state information is maintained there
and then it can request services via AJAX from the server. Services
might be:

Authentication Service
Information requests
Data storage requests
etc

Your data storage services might store application data, application
state data, etc. In many ways this is what might have been stored in a
persistent session.

You could use php servlets to implement the services. Similar ideas, but
different way of decomposing the application into components. Smaller
modular components foster reuse.

-Steve

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to