tags:

views:

23

answers:

1

Hi,

is it possible to define a PHP Session var through AJAX? I'm doing it in the background of a script and it seems to be kind of random.

A: 

Yes, most definitely. As long as the AJAX endpoint is on the same server as the rest of your site, this will definitely work.

Remember, AJAX is HTTP messaging just like any other normal web page request. This means any registered cookies for the domain will be sent with those AJAX requests, which means the session can be used.

Peter Bailey