Welcome Guest, Not a member yet? Register   Sign In
Session Data for AJAX Calls in CI 3.x?—SOLVED
#1

(This post was last modified: 11-18-2016, 07:41 PM by VikRubenfeld.)

UPDATE: My boss is telling me I will have to revert to CI 2.x if I can't get this fixed by Monday.

Is there anything I can look at to start to track this down?

I've just upgraded to CI 3. On my development server everything is working great. I'm trying it out now on my production server and I notice that on AJAX calls, $CI->session->userdata has a value in the field for __ci_last_regenerate, but the other fields (status, user_id, and username) are blank. The system thinks the user is not logged in.

Thanks very much in advance to all for any thoughts/info/directions/pointers.
Reply
#2

It's not an ajax call-- my apologies. It is a call in javascript, but it's not ajax-- it is:

PHP Code:
window.location "https://myHostName/myController/myFunction/"

Why would it make any difference to the session, if a URL is called this way, rather than entered in the browser URL bar?
Reply
#3

(This post was last modified: 11-18-2016, 07:48 PM by VikRubenfeld.)

Using relative URLs fixed it:

Before (not working):
Code:
window.location = "https://mySite.com/myController/myFunction";

After (working):
Code:
window.location = "/myController/myFunction";
Reply




Theme © iAndrew 2016 - Forum software by © MyBB