Lamp was installed on my local pc whose os is debian8 .
That is to say the client and server were all installed on my local pc.
The following code was saved as setcookie.php on my local pc.
<?php
setcookie("user", "Alex Porter", time()+36000);
?>
<html>
<body>
</body>
</html>
Now php setcookie.php
was executed on my local pc.
The following codes were all executed on my local pc.
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 there is no info selected for both of them ?
Do my cookie be set or not in my firefox?
If it is set on my firefrox,why can't be selected in the sqlite statement?
In my opinion , the sql command select * from moz_cookies where name="Alex Porter";
will get such something as
name user value Alex Porter expires 1515832198
Nothing display.
Do as Aadil P. say the file was saved as setcookie.php in /var/www/html/tmp/setcookie.php.
Executed 127.0.0.1/tmp/setcookie.php in firefox.
Open the Cookies with firebug.
The right result displayed here.
Two problem remains:
1.How many fields for the 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 are only name,value,domain,raw size,path,expires,httponly,security in firebug cookies widow.
Why they are not the same?How many cookie elements on the related international standard?
2.How to write the proper sql command?
select * from moz_cookies where name="user";
select * from moz_cookies where Name="user";
Both of them get nothing.