SQLite Forum

Non primary key alias to rowid
While the implicitly created rowid column might not be stable (I think it can be changed when doing things like a vacuum) an explicitly declared alias (like with INTEGER PRIMARY KEY) will be stable, and its value not changed, so it is suitable for being referenced by other tables. If you need to make sure that the old values of the primary key are not reused, you can add the autoincrement option to the key (although, you will still be able to manually reuse an old ID number).

To my knowledge, in SQLite, only the primary key has the ability to autofill with unique values, other columns can be made unique, so you can't insert duplicates, but only the primary key has the ability to be auto-filled with unique values.

The best way to get get a column that will always have unique values is to make the table have an INTEGER PRIMARY KEY, and as far as I know, such a table can be used with sessions.