How to set my cookie or not in my firefox?

The lamp was installed on my local computer, os - debian8.
That is, the client and server were installed on my local computer.
The following code was saved as setcookie.php on my local computer.

<?php setcookie("user", "Alex Porter", time()+36000); ?> <html> <body> </body> </html> 

Now php setcookie.php been executed on my local computer. The following codes were executed on my local computer.

 find / -name "cookies.sqlite" /home/debian8/.mozilla/firefox/joww2h34.default/cookies.sqlite sqlite3 /home/debian8/.mozilla/firefox/joww2h34.default/cookies.sqlite sqlite> .tables moz_cookies sqlite> PRAGMA table_info([moz_cookies]); 0|id|INTEGER|0||1 1|baseDomain|TEXT|0||0 2|appId|INTEGER|0|0|0 3|inBrowserElement|INTEGER|0|0|0 4|name|TEXT|0||0 5|value|TEXT|0||0 6|host|TEXT|0||0 7|path|TEXT|0||0 8|expiry|INTEGER|0||0 9|lastAccessed|INTEGER|0||0 10|creationTime|INTEGER|0||0 11|isSecure|INTEGER|0||0 12|isHttpOnly|INTEGER|0||0 sqlite> select * from moz_cookies where name="Alex Porter"; sqlite> select * from moz_cookies where name="user"; 

Why is there no information chosen for both of them?
How to set my cookie or not in my firefox? If it is installed on my firefrox, why can't sqlite be selected in the statement?
In my opinion, the sql select * from moz_cookies where name="Alex Porter"; will get something like

 name user value Alex Porter expires 1515832198 

Nothing is displayed. Do as Aadil P. said, the file was saved as setcookie.php in /var/www/html/tmp/setcookie.php. Performed 127.0.0.1/tmp/setcookie.php in firefox.
Open Cookies with firebug.

enter image description here

The correct result is displayed here.
Two problems remain:
1. How many fields for cookie?

 PRAGMA table_info([moz_cookies]); 0|id|INTEGER|0||1 1|baseDomain|TEXT|0||0 2|appId|INTEGER|0|0|0 3|inBrowserElement|INTEGER|0|0|0 4|name|TEXT|0||0 5|value|TEXT|0||0 6|host|TEXT|0||0 7|path|TEXT|0||0 8|expiry|INTEGER|0||0 9|lastAccessed|INTEGER|0||0 10|creationTime|INTEGER|0||0 11|isSecure|INTEGER|0||0 12|isHttpOnly|INTEGER|0||0 

There is only name, value, domain, raw size, path, expire, httponly, firebug cookie inspiration security.
Why don't they match? How many cookie elements comply with the relevant international standard?

2.How to write the correct sql command?

 select * from moz_cookies where name="user"; select * from moz_cookies where Name="user"; 

Both of them get nothing.

+6
source share
2 answers

You use php setcookie.php to execute the php file via cli (as per your comment). A cookie or HTTP cookie is stored in a user’s web browser .... [According to Wikipedia - https://en.wikipedia.org/wiki/HTTP_cookie]

You need to open / execute this php file in the browser as indicated by CL.

Since you have LAMP installed, move the script (php) file to the LAMP folder and open the page in the browser by calling the file, the address bar of your URL should look like http: //localhost/setcookine.php (or http: //127.0. 0.1 / /setcookie.php) or something similar depending on where the file is located.

Edit: Why don't you try listing all the cookies for the table simply

 SELECT id,name FROM moz_cookies; 

to see if there are cookies at all? If you see a cookie in the list, then your request has an error, otherwise you may end up in the wrong sqlite file at all.

Try the following:

 select * from moz_cookies where name like "%name%"; 
+6
source

To set a cookie in Firefox, you need to browse the web page in Firefox.

You probably want to run the PHP server on the local computer .

+4
source

All Articles