PHP Session Timing Out Soon

I am working on a PHP role based application in which I have to maintain session as well. once the user is logged in he will be redirected to his interface where I manage session as The user id and …

PHP cookies and redirection

I have a website in two languages: English and French. And I want to redirect people based on their browser languages: if there browser language is French, I redirect people on /fr, else they go to …

PHP How to completely destroy a session after leave the page

I want to make a simple PHP page where you can only access if you log in first. My code is something like this: if (the user logged in correctly) { session_start(); echo “THE HTML PAGE. (I did …

PHP how to calculate days between 2 array session dates?

I’m sorry for the terribly long question. I just want to make sure that this problem is fully addressed: so through an html form, I asked user to give four information five times: deliveryby, itemNo, …

solving problems in session? [closed]

I have created two pages , one is index.php and admin.php . In the first page or index.php , i have created a loggin form so that i can access the admin.php page trough the loggin or like this enter …

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 …

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 …