Hi All,
Just wondering how you go about changing the value of a session cookie
via javascript?
I have a PHP page that sets a session cookie when it first loads. I'd
like to be able to change the value of that session cookie in response
to a button click in a form, without resubmitting the page.
For some reason, the following doesn't seem to work:
document.cookie = 'myinfo=newvalu e';
When I reload the page, the value in the session cookie originally set
by the PHP code has been retained, rather than changing to the new
value set by the JavaScript.
Can anyone give me any thoughts on why this session cookie is
resisting the JavaScript change?
Many thanks,
Murray
Just wondering how you go about changing the value of a session cookie
via javascript?
I have a PHP page that sets a session cookie when it first loads. I'd
like to be able to change the value of that session cookie in response
to a button click in a form, without resubmitting the page.
For some reason, the following doesn't seem to work:
document.cookie = 'myinfo=newvalu e';
When I reload the page, the value in the session cookie originally set
by the PHP code has been retained, rather than changing to the new
value set by the JavaScript.
Can anyone give me any thoughts on why this session cookie is
resisting the JavaScript change?
Many thanks,
Murray
Comment