Page 1 of 1

Creating a session with Javascript that can be read by PHP?

Posted: Thu Oct 06, 2005 12:08 am
by robster
Hi all, I have a session, this is an example of the content this session could contain:

Code: Select all

$_SESSION['nav']['client_id'] = "1"; //Make the first client they see client #1
$clientid = $_SESSION['nav']['client_id'];
So you get the idea, with PHP that is how I would stick the contents into $clientid.


How can I get this with javascript though? How can I create a session in a javascript script I've written that can then be read by the PHP script later down the track with the code $clientid = $_SESSION['nav']['client_id'];

Can it be done at all?

All advice appreciated,

Rob

Posted: Thu Oct 06, 2005 12:30 am
by John Cartwright

Posted: Thu Oct 06, 2005 1:05 am
by robster
thanks,

It says that you can create a session cookie but you cannot manipulate any of the variables associated with one from within Javascript directly.

That means I cannot do what I want to do correct?

Or have I misread this (shrug)?

Posted: Thu Oct 06, 2005 9:03 am
by feyd
robster wrote:That means I cannot do what I want to do correct?
bingo.