codesite-nore
...@google.com wrote:
> First pass Session handler.
Aside from the session table, where is the session handler? ;)
> +CREATE TABLE {$prefix}sessions (
> + session_id INT UNSIGNED NOT NULL auto_increment,
> + token varchar(255) NOT NULL,
> + subnet INT UNSIGNED NOT NULL DEFAULT 0,
> + expires INT UNSIGNED NOT NULL DEFAULT 0,
> + ua VARCHAR(255) NOT NULL,
> + data MEDIUMTEXT,
> + PRIMARY KEY (session_id),
> + UNIQUE KEY token (token)
> );
Why did you include a session_id column? Is that something we're likely
to need? I think the token should be unique across all sessions, so it
should be the primary key used to select a session from the DB. Using
session IDs doesn't seem to gain us anything.
Also, I think we should store the user's ID as a distinct column in the
table, so that we can quickly fetch the user with User::get_by_id().
--
GPG 9CFA4B35 | ski...@skippy.net | http://skippy.net/