我在 SQL Server 之上使用 Laravel,并且试图将 PHP 会话存储在数据库中。我已经根据http://laravel.com/docs/session#database-sessions创建了会话表,但是在加载页面时出现以下错误:
PDOException was thrown when trying to read the session data: SQLSTATE[22001]: [Microsoft][SQL Server Native Client 11.0][SQL Server]String or binary data would be truncated.
更新:
我通过手动创建表来解决这个问题:
CREATE TABLE portal_sessions (
id VARCHAR(255) PRIMARY KEY NOT NULL,
last_activity INT NOT NULL,
payload TEXT NOT NULL);