Giter VIP home page Giter VIP logo

Comments (13)

stefangabos avatar stefangabos commented on May 30, 2024

are you using the latest version?

from zebra_session.

stefangabos avatar stefangabos commented on May 30, 2024

are you using a load balancer? is something (like a browser extension) changing your browser's user agent?

from zebra_session.

stefangabos avatar stefangabos commented on May 30, 2024

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.

poisons77 avatar poisons77 commented on May 30, 2024

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.

stefangabos avatar stefangabos commented on May 30, 2024

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.

poisons77 avatar poisons77 commented on May 30, 2024

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.

stefangabos avatar stefangabos commented on May 30, 2024

everything seems fine there

from zebra_session.

poisons77 avatar poisons77 commented on May 30, 2024

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.

stefangabos avatar stefangabos commented on May 30, 2024

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.

poisons77 avatar poisons77 commented on May 30, 2024

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.

stefangabos avatar stefangabos commented on May 30, 2024

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.

poisons77 avatar poisons77 commented on May 30, 2024

Thanks for your prompt response Stefangabos, it seems all ok now!

from zebra_session.

stefangabos avatar stefangabos commented on May 30, 2024

Thank you!

from zebra_session.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.