You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Http/Session.php
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ public function start(): void
114
114
// regenerate empty session
115
115
if (empty($nf['Time'])) {
116
116
$nf['Time'] = time();
117
-
$this->regenerated = true;
117
+
$this->regenerateId();
118
118
}
119
119
120
120
// resend cookie
@@ -139,11 +139,6 @@ public function start(): void
139
139
}
140
140
}
141
141
142
-
if ($this->regenerated) {
143
-
$this->regenerated = false;
144
-
$this->regenerateId();
145
-
}
146
-
147
142
register_shutdown_function([$this, 'clean']);
148
143
}
149
144
@@ -204,7 +199,10 @@ public function exists(): bool
204
199
*/
205
200
publicfunctionregenerateId(): void
206
201
{
207
-
if (self::$started && !$this->regenerated) {
202
+
if ($this->regenerated) {
203
+
return;
204
+
}
205
+
if (self::$started) {
208
206
if (headers_sent($file, $line)) {
209
207
thrownewNette\InvalidStateException('Cannot regenerate session ID after HTTP headers have been sent' . ($file ? " (output started at $file:$line)." : '.'));
210
208
}
@@ -215,6 +213,8 @@ public function regenerateId(): void
0 commit comments