Questions tagged [session-set-save-handler]

Sets user-level session storage functions in PHP.

27 questions
1
vote
2 answers

session_set_save_handler is not working

I've been trying to set up saving sessions with session_set_save_handler() and i dont know what's the problem, i have all my callable functions but sth is going wrong, here i post my code. btw i'm working in WP.
claucgmz
  • 11
  • 1
  • 3
0
votes
2 answers

session_set_save_handler write function is not called on gcloud

I run app on google cloud platform using php in standard mode. I use session_set_save_handler to store session in mysql database. .php file ... $mysqli = new mysqli($config->host, $config->user, $config->password, $config->db, $port, $socket); //…
Simon
  • 22,637
  • 36
  • 92
  • 121
0
votes
1 answer

Session_set_save_handler not writing to database

I'm currently learning php and trying to write session data to my database without success. I have a setup with Apache24, PHP 7 environment and Postgresql database. When I instantiate sessionhandling class ($sess = new sessionhandling) in my other…
om78
  • 15
  • 1
  • 9
0
votes
2 answers

session_set_save_handler - Why isn't this code working?

I've been trying to save PHP session data in a MySQL database, but can't get it to work. For a simple example, here's code that should increment a counter with each visit. I've seen other examples, etc. but can someone please tell me why this code…
TMG
  • 500
  • 2
  • 6
  • 13
0
votes
3 answers

Session_id behaving weirdly

So I have SessionHandler class, and my other file that put that into motion like this (cfg_session.php): use \Classes\MySessionHandler as Sessao; $sessao = new Sessao(); // PHP < 5.4 session_set_save_handler( array($sessao, 'open'), …
Kelwen Souza
  • 109
  • 6
0
votes
1 answer

PHP mysqli->real_escape_string when using sessions saved in the DB

Ok, I hope I've got everything listed up nicely before posting this question because I've found bits and pieces of a solution here and there but no real answer to my issue. 1: I'm using a singleton MySQL connection with mysqli, not using stored…
qwertzman
  • 784
  • 1
  • 9
  • 23
0
votes
1 answer

Warning: session_set_save_handler() expects parameter 1 to be SessionHandlerInterface, object given

I've searched for a solution to this issue in numerous places with no luck. I'm at a complete loss, I'm new to modifying sessions and trying to implement a secure session interface and session handler. The error I get is Warning:…
NMaduro
  • 21
  • 1
  • 1
  • 12
0
votes
1 answer

Session variable does not preserves the value on next page in php with MongoDB?

I am implementing a simple session manager with PHP and MongoDB. But somehow the $_SESSION is empty on next page, assigned value on first page though.. class SessionManager { //name of collection where sessions will be stored const COLLECTION =…
Hiren
  • 613
  • 1
  • 8
  • 25
0
votes
1 answer

Database-based session classes/libraries without session_set_save_handler()

I'm currently in the process of writing a PHP 'plug-in' that tracks sessions across unique domains. In order to do this, I've figured the best way to handle 'sessions' across different domains is to write my own Session class/library. I've…
James Spittal
  • 235
  • 5
  • 12
0
votes
1 answer

PHP session_set_save_handler not saving to database

I created a class to save the session data to a database. it is not saving to the database and there are no errors. Any idea why? here is the class.
Adam Mills
  • 11
  • 1
  • 1
  • 6
0
votes
1 answer

setting up php session (session_set_save_handler)

I am trying to set up a user login/logout system using php and mysql. I have found some documentation on the subject here: http://phpmaster.com/writing-custom-session-handlers/. I am trying to follow along with it (I have also been pulling from…
ewizard
  • 2,801
  • 4
  • 52
  • 110
-1
votes
1 answer

Call a function/handler when session get destroyed

i wrote a Website in PHP with user authentification. I used sessions for this. When a user logs in, a flag in a database is set and when he logs out this flag is reseted. This prevents that one user can login multiple times into the Website. All…
cominfotty
  • 441
  • 1
  • 6
  • 10
1
2