Comments (13)
are you using the latest version?
from zebra_session.
are you using a load balancer? is something (like a browser extension) changing your browser's user agent?
from zebra_session.
are you sure you are not calling regenerate_id on each request? also, make sure the sessions are not considered as "expired" too early - see documentation
from zebra_session.
sorry for the late reply.
- I'm using version 3.0 (last revision: January 28, 2020)
- I'm not using any load balancer
- I call regerate_id only once, after login
I've now forced the $session_lifetime to 600 seconds, and the issue still didn't back. I'll reopen this issue if it does. In the meantime if there's a suggestion on what to check or log to find the cause would be great.
from zebra_session.
Make sure you are calling the constructor with the defaults
<?php $session = new Zebra_Session($link, 'SomeThingSomeThing');
also, please post the result of
<?php
print_r('<pre>');
print_r($session->get_settings());
from zebra_session.
This is my calling
$session = new Zebra_Session($connection, $sessionSecurityCode);
and this is the result of get_settings()
Array
(
[session.gc_maxlifetime] => 36000 seconds (600 minutes)
[session.gc_probability] => 1
[session.gc_divisor] => 1000
[probability] => 0.1%
)
from zebra_session.
everything seems fine there
from zebra_session.
Ok this is reproducible.
I load a page, desktop version, the session is set and a row created in the DB. I toggle the "switch device" on chrome devTools and reload the page, mobile view now. From now on there is no way to save a session variable in the DB, nor a new session is created (the user agent changes), the only way is to manually delete the relative session row from the DB and it will create a new session on next page load. In the settings, I've $lock_to_user_agent set as default, so TRUE.
from zebra_session.
this is expected if the user agent changes - this is why i asked about this in my first comments. making it ignore the user agent should fix it but i don't recommend leaving it that way in production
from zebra_session.
Yes, for some reason the user agent changed, I had no clue about what the reason, that's why I opened this topic, Thanks to your first comment I tried to force a user agent change, and then reported. Before closing the issue, should not it create a new session? The problem is that on changing the user-agent the session remain "alive", I mean the session_expire field is updated, the session_data field is emptied and remain empty, and so no more session variables can be stored. Should not it just create a new row with a new session ID? Changing the $lock_to_user_agent setting to FALSE doesn't change the result
from zebra_session.
There was a bug where changing the user agent after initialization would make the session unusable from that point on. It should now be fixed.
Note that when changing the user agent, the entry in the database will not be deleted but will be reused (but the value in the hash
column will change and the session values will be deleted)
Please have a look. And again thank you for your feedback!
from zebra_session.
Thanks for your prompt response Stefangabos, it seems all ok now!
from zebra_session.
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
- 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
- String too long 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.