Skip to content

Commit a81ffb1

Browse files
authored
Merge pull request #56 from ingenerator/bug-truncate-session-user-agent
Truncate user_agent to fit session database column
2 parents 3181bec + 6e95262 commit a81ffb1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
### Unreleased
22

3+
* Fix bug where devices with long user agents generated a database exception when attempting to create a session.
4+
35
### v1.19.2 (2023-04-27)
46

57
* Add assertCapturedOneExactTimer helper. Allowing you to simultaneously assert only

src/Session/MysqlSession.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function create_sid(): string
168168
'hash' => $this->calculateHash(),
169169
'data' => '',
170170
'now' => \date('Y-m-d H:i:s'),
171-
'user_agent' => $this->client_user_agent,
171+
'user_agent' => mb_substr($this->client_user_agent, 0, 255),
172172
'ip' => $this->client_ip,
173173
]
174174
);

0 commit comments

Comments
 (0)