There are a lot of Stack Overflow questions which advise using separate cookies to keep session parameters, but I don’t want to store any additional cookies on the client side. At the moment I have a new session with empty session parameters after each browser restart. Is there any way to keep the PHP session active after each browser restart?
Tag: session
How to load users name from session ID, PHP
How do I load a user’s name from his session ID? So it should work like this: User goes on the website for the first time (gets his session id) enters his name and from now on gets redirected to the …
How to keep a user logged in with PHP Sessions for 1 year?
I’m currently using the following code: ini_set(‘session.gc_maxlifetime’, 31968000); ini_set(‘session.gc_probability’, 1); ini_set(‘session.gc_divisor’, 1); ini_set(‘session.cookie_lifetime’, 31968000)…
php redis session save handler extending function gc (garbage collection)
Is there a way to extend phpredis session.save handler to call a function when garbage collection happens? ini_set(‘session.save_handler’,’redis’); //code to set an additional gc …
(Spotify) how to stop cross browser session sharing?
I’m using the spotify api and for some reason their session class blocks to store own data in $_SESSION. As a workaround I wrote a class ‘SystemHelper’: namespace App; It is possible now to store data in $_SESSION but the problem is that as long as I’m logged in with my account (own login form, not spotfiy account), everybody else
PHP – How to use csrf token in multiple forms on the same page
I have 2 forms on the same page. I want to use the csrf token in both forms. when I try to use it, it regenerates the csrf token on form submission. How can I solve this? <?php function csrf_token(…
Avoid session timeout reset when sending ajax request
Is it possible to tell codeigniter to skip session timeout reset if post request is coming via ajax to a particular controller function. I have a frequent ajax call inside user login dashboard to …
PHP Login session with cookie
Please take a look at this code. Is it possible to use it to register the user through cookies if (isset($_COOKIE[‘rand_nm’]) && isset($_COOKIE[‘token’])) { $…
When using MySQL to store session data, is it faster to use db queries instead of session?
I used a guide to redirect session requests to a DB call so I could maintain a session on front and backend PHP (this guide: from : https://culttt.com/2013/02/04/how-to-save-php-sessions-to-a-database/), but that leaves me with a question. I can see that the session data is stored JSON in the db. Near as I can tell, that means every time I update $_SESSION
How do I store multiple similar data in a session array in PHP?
I would like to be able to submit multiple times and store the data in a session array to be accessed in other server pages. I’n not sure how to do it. &…