2

If i call a php script using ajax im unable to access session variables set by another php script though both scripts are on the same domain, and i have session_start() in both the scripts. If however the php script is called directly it is able to access session variables. Why does this happen ?. Any way to fix the problem ?

Please Help. Thank You.

1 Answer 1

2

Use something like Firefox's HTTPFox or FireBug to view what's going across the wire when you directly visit the URL or do it via Ajax. Most likely the session cookie isn't being sent properly (or at all) with the AJAX call, so a new blank session is being created.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.