Skip to content

Tag: session

Can’t execute script if session not set

Good morning, I am trying to develop a link shortener system with statistics in php (5.6). One of these stats is the number of sessions. I am trying to use this logic: With my first approach i tried to put session_start in the middle of the code and it didn’t work. I realized I can’t do it and I m…

PHP session update at certain time

I have a php website where I need to unsubscribe a student after one month for example .. for each student I have a “subscribed” value in the mysql database where it can be 0 (unsubscribed) or 1 (subscribed).. I also have a registration date whereby I can know the time after one month for each stu…

How to use session without using $_SESSION in wordpress

I am trying to create a session without using php $_SESSION variable and without letting user to log in on the website. I created a form and once a visitor/guest user submit the form, I want to store his data in a session variable. I found that using $_SESSION is not a good practice in wordpress. I looked aro…

Cannot Redirect to the correct page using PHP session

In my application I have 4 roles. As per the roles, Users can view their access different pages. Currently I am maintaining 2 different sessions. $_SESSION[‘user_id’] and $_SESSION[‘role_id’]. My problem is, suppose we say the role_id =1 is Admin, role_id=2 is Doctor. If I logout from …

How to prevent PHP SESSION closing when the page is refreshed?

I have created Signup and Login systems for my gallery website. When a user tries to login into system, their user and password and admin privilege is checked. If it was successful, the username is appeared on top left corner of the home page and Login turns to Logout. The problem is that when I refresh the p…