let now = Math.round(Date.now() / 1000);
conn.executeSimpleSQL( "INSERT INTO moz_cookies(" + "baseDomain, host, name, value, path, expiry, " + "lastAccessed, creationTime, isSecure, isHttpOnly) VALUES (" + "'foo.com', '.foo.com', 'foo', 'bar=baz', '/', " +
now + ", " +
now + ", " +
now + ", 1, 1)"
);
// Now start the cookie service, and then check the fields in the table. // Get sessionCookies to wait for the initialization in cookie thread
Services.cookies.sessionCookies;
Assert.ok(conn.schemaVersion >= 13);
let stmt = conn.createStatement( "SELECT sql FROM sqlite_master " + "WHERE type = 'table' AND " + " name = 'moz_cookies'"
); try { Assert.ok(stmt.executeStep());
let sql = stmt.getString(0); Assert.equal(sql.indexOf("appId"), -1);
} finally {
stmt.finalize();
}
stmt = conn.createStatement( "SELECT * FROM moz_cookies " + "WHERE host = '.foo.com' AND " + " name = 'foo' AND " + " value = 'bar=baz' AND " + " path = '/' AND " + " expiry = " +
now + " AND " + " lastAccessed = " +
now + " AND " + " creationTime = " +
now + " AND " + " isSecure = 1 AND " + " isHttpOnly = 1"
); try { Assert.ok(stmt.executeStep());
} finally {
stmt.finalize();
}
conn.close();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.