# \#session

**URL:** https://discourse.laminas.dev/tag/session/19.md

[Latest](https://discourse.laminas.dev/latest.md) · [Categories](https://discourse.laminas.dev/categories.md) · [Tags](https://discourse.laminas.dev/tags.md)

---

## [DbTableGateway: gc($maxlifetime)](https://discourse.laminas.dev/t/dbtablegateway-gc-maxlifetime/1573)

<div class="topic-metadata">

**Author:** [@damac23](https://discourse.laminas.dev/u/damac23)\
**Replies:** 0\
**Last updated:** [April 30, 2020, 10:16am UTC](https://discourse.laminas.dev/t/dbtablegateway-gc-maxlifetime/1573 "2020-04-30T10:16:55Z")

</div>

Hi, after building some failover-structures I came across the problem to cleanup expired sessions in the database-table with gc(). The problem there is: the function requires $maxlifetime but does not use it - it uses …

---

## [CSRF and expired session](https://discourse.laminas.dev/t/csrf-and-expired-session/1247)

<div class="topic-metadata">

**Author:** [@jbelien](https://discourse.laminas.dev/u/jbelien)\
**Replies:** 4\
**Last updated:** [November 12, 2019, 3:11pm UTC](https://discourse.laminas.dev/t/csrf-and-expired-session/1247 "2019-11-12T15:11:30Z")

</div>

Hello everyone, I started using zend-expressive-csrf to protect my login page against CSRF following the documentation (CSRF Guards and CSRF Guard Middleware). It works (of course) really great except when the session …

---

## [Zf3 Distroy Session after one hour](https://discourse.laminas.dev/t/zf3-distroy-session-after-one-hour/925)

<div class="topic-metadata">

**Author:** [@Jilco](https://discourse.laminas.dev/u/Jilco)\
**Replies:** 0\
**Last updated:** [January 29, 2019, 5:30pm UTC](https://discourse.laminas.dev/t/zf3-distroy-session-after-one-hour/925 "2019-01-29T17:30:23Z")

</div>

Is there a way to destroy a session started after 1 hour? I made the next configs in the global.php, but the sessions are stil present after 20 seconds in the apache folder… And the application stil uses that session… r…

---

## [Unit testing with session](https://discourse.laminas.dev/t/unit-testing-with-session/742)

<div class="topic-metadata">

**Author:** [@jbelien](https://discourse.laminas.dev/u/jbelien)\
**Replies:** 5\
**Last updated:** [September 21, 2018, 8:50am UTC](https://discourse.laminas.dev/t/unit-testing-with-session/742 "2018-09-21T08:50:06Z")

</div>

Hello everyone, I’m rather new to unit testing (better late than never ^^) and I started using PHPUnit based on Zend Expressive skeleton. I analyzed the 3 available tests and understood how it works. But my applicatio…

---

## [Session injection via constructor](https://discourse.laminas.dev/t/session-injection-via-constructor/319)

<div class="topic-metadata">

**Author:** [@harikt](https://discourse.laminas.dev/u/harikt)\
**Replies:** 6\
**Last updated:** [October 16, 2017, 3:47pm UTC](https://discourse.laminas.dev/t/session-injection-via-constructor/319 "2017-10-16T15:47:48Z")

</div>

Hi all, I am not a big fan of retrieving dependencies via Request attributes. I believe dependencies should be explicit. So the big picture : I have pet project called web.expressive which tries to integrate the dms w…

---

## [RFC: PHP Session and PSR-7](https://discourse.laminas.dev/t/rfc-php-session-and-psr-7/294)

<div class="topic-metadata">

**Author:** [@enrico](https://discourse.laminas.dev/u/enrico)\
**Replies:** 13\
**Last updated:** [September 28, 2017, 3:27pm UTC](https://discourse.laminas.dev/t/rfc-php-session-and-psr-7/294 "2017-09-28T15:27:11Z")

</div>

PHP Sessions are used in many web application to store user’s data on the server. For instance, the majority of the PHP applications with a login page (with username and password) use Session. The usage of PHP functions…
