Welcome Guest, Not a member yet? Register   Sign In
Session data lost/destroyed with an Ajax call
#1

Hi
I've been working on a local virtualhost on my PC with a codeigniter app
I've made a route ("main"). In the associated controller, I set some session data and load a main_view

In the main_view, there's a button that makes an ajax (post) call to another route ("service")
The "Service" controller associated to this route just loads the session data set in "main" and returns it to the main_view as data response to the ajax call

The problem is that in my PC (locally set virtualhost) this works fine, but when working on a https://codeigniterapp.mysite.com this does not work
The main route loads, the session data is set, cookie is set and written with correct values, etc.
But when the ajax call is made to "service", the session data is empty and an empty array is returned to the view

I've tried moving from
Code:
public string $driver = FileHandler::class;
to
Code:
public string $driver = DatabaseHandler::class;

The cookies are saved to database etc. correctly, but this didn't change the behaviour. The session data keeps being returned empty in the ajax call

Any ideas or suggestions to solve this?
Thanks a lot
Reply
#2

The method in Routes and that ajax sends? Get/Post
Filters? CSRF protection?
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB