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 moved

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 student. the question is,

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 around some

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 this session as Admin and logging as a Doctor to the site. Then I

How to integrate React App With Laravel Sanctum on Apache2

I use React App on localhost:3000 For Laravel API I use apache2 from Laradock and site is: site.localhost To authorize users I use Sanctum Problem is I can not get cookies from sanctum/csrf-cookie (i got them in response header but they are not appear in cookies) and then got 419 code when i try to login via API My .env

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 page, the user

How to submit multiple requests to the function to send all submitted requests

I’m trying to submit several requests to a function that writes them to a session that then returns them here I submit the data to the function this is the function we use call session when it executes the script it returns the last request only – $this->Notification->build(‘error’, ‘Test1’, ‘danger’, ‘bottom-left’, 0, ‘true’); Answer You can pass an array but