Comments (4)
I haven't encountered this issue but it looks like something related to a db difference rather than it being related to PHP version difference.
Here it says that this happens when MySQL is in strict mode
and it may be that on a previous environment it wasn't. The result in both cases is the same - data longer than the supported size is written to the db, BUT TRUNCATED TO FIT!, the only difference being that a warning is generated in strict mode, while the action is done silently when not in strict mode (and maybe this is why you had no errors previously)
If the data you have is really large you can change the session_data
column type to MEDIUM BLOB
or LONG BLOB
depending on the size of the data you are planning to store.
Also, if you have to store so much data in the session a better solution would be to use redis
or memcache
instead of the session
from zebra_session.
In my previous comment I forgot to mention that although data is indeed written to the db, it is truncated to fit the allowed size. I updated my previous comment
from zebra_session.
great answer
from zebra_session.
Great response. Very helpful. Your instinct about the use of strict mode was spot on. It is possible that the amount of session data grew directly as a result of changing PHP versions, but it is more likely that the use of session data grew as the code features/functionality continued to expand after the change, Combined with the strict mode defaults for PHP 8, the error resulted. The net result is that changing the session_data
column to MEDIUM BLOB fixed the issue. Thank you!
from zebra_session.
Related Issues (20)
- session data missing after renew session in database HOT 1
- this session class can be deleted! HOT 26
- Empty Session HOT 13
- Are there any reason you don't use SessionHandlerInterface class? HOT 1
- Can't connect Zebra Session with PDO? HOT 7
- transition to PDO ? HOT 11
- If calling die(), will the session get closed/lock get released or not? HOT 2
- Question: session_id($id) does not change sid HOT 1
- get_lock doesn't work HOT 3
- Logging Out Users HOT 6
- keep session even if browser is close HOT 1
- How to show alert when session is expired? HOT 14
- zebra_session could be use in AWS ALB? HOT 2
- session_start gives an unkown error HOT 2
- Session Lifetime of 0 (zero) Behaves Differently on PHP 8 - Expires Immediately HOT 5
- Divide by zero error when calling get_settings() HOT 1
- session_set_save_handler signature changing in PHP 8.4 HOT 1
- PHP 8.2 throws deprecation notices for two dynamic properties HOT 1
- $session->set_flashdata() not working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zebra_session.