File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,6 @@ private function stampCreated(int $lifetime = null): void
163163 {
164164 $ timeStamp = time ();
165165 $ this ->meta [self ::CREATED ] = $ this ->meta [self ::UPDATED ] = $ this ->lastUsed = $ timeStamp ;
166- $ this ->meta [self ::LIFETIME ] = $ lifetime ?? ini_get ('session.cookie_lifetime ' );
166+ $ this ->meta [self ::LIFETIME ] = $ lifetime ?? ( int ) ini_get ('session.cookie_lifetime ' );
167167 }
168168}
Original file line number Diff line number Diff line change @@ -136,4 +136,14 @@ public function testDoesNotSkipLastUsedUpdate()
136136
137137 $ this ->assertEquals ($ timeStamp , $ sessionMetadata [MetadataBag::UPDATED ]);
138138 }
139+
140+ public function testLifetimeIsInt ()
141+ {
142+ $ sessionMetadata = [];
143+
144+ $ bag = new MetadataBag ();
145+ $ bag ->initialize ($ sessionMetadata );
146+
147+ $ this ->assertIsInt ($ bag ->getLifetime ());
148+ }
139149}
You can’t perform that action at this time.
0 commit comments