PHP Sessions & Ajax

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

PHP Sessions & Ajax

Post by Mr Tech »

I'm using php and ajax to submit some stuff on a script of mine. However, in order to submit something, you need to be logged in. The script uses $_SESSION to track the login data.

When I submit something using ajax, the PHP file which the ajax file submits to does not seem to be able to read any $_SESSION data. As a result, you can't track login details....

Is there a way around it? Or am I doing something wrong?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Put the session ID in the request URL.
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Post by Mr Tech »

Sweet! Thanks mate!
Post Reply