php session not working in chrome and IE but working fine in Firefox
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
php session not working in chrome and IE but working fine in Firefox
I have php session not working in chrome and IE but working fine in Firefox. I'm getting this error in page4.: it show variable empty in page4, session not passing in page4 after the user click click me in page3
Notice: Undefined index: username in /var/www/html/phptest/test4.php on line 5
Please see my code and let me know where the error is.
I'm not sure. I copied your code verbatim and it worked.
As stated make sure you start at page2 in each browser. Session variables are not common between browsers.
Sure ... the session cookies aren't being returned by the browser. The session-store has been created, the cookie has been sent, but it never comes back.
Activate the debugging facilities on Chrome and IE on the client side, and w-a-t-c-h the exchanges. You should see the host returning a set-cookie: request, and you should see the cookie value being stored. You should then see a request being sent to the same URL (note that "secure" and "non-secure" connections are distinct!), and the cookie-value should accompany it in the header.
i have figure out what exactly the problem is.
session_id(); not passing the same id number to the second page in result session file are created empty. Browser like IE and Chrome are not able to pick up session variable.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.