S
S
Sererator2012-05-13 00:03:47
PHP
Sererator, 2012-05-13 00:03:47

Question about hypertext cookies (HTTP Cookies)

Is it possible to set a Cookie in such a way that it is sent to the server and back only to the address "test/test.php", but not to "test/test.php*" (for example, "test/test.php?ddd=sss "")? If not, what other option is possible?

LocalStorage from js with an ajax request and don't suggest passing a parameter in the GET request itself;).

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vyacheslav Golovanov, 2012-05-13
@SLY_G

It is forbidden. You can set the domain and path, and all parameters are ignored.
Why can't test.php itself ignore cookies if certain parameters are passed to it?
Alternatively, you can set up rewrite paths. Instead of test/test.php?ddd=sss it would be test/ddd/sss
AND set cookies that work for test/ but don't work for test/ddd

V
Vladimir Kudinov, 2012-05-13
@frux

If the presence of cookies is so important, write at the beginning of the script:

<?
if($_GET){
    $_COOKIE = Array();
}
?>

S
SerDIDG, 2012-05-13
@SerDIDG

Cookies are sent on any request to the server. I don't know what your task is, but you can make a form with input type="hidden", which will only appear on "test/test.php" and fill out.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question