sessions not working

Problems with the Windows version of XAMPP, questions, comments, and anything related.

sessions not working

Postby dr john » 03. January 2010 15:21

I downloaded and installed the latest version of xampp for windows - xampplite-win32-1.7.3.exe.

I copied from a server a site I made several years ago, to test a few things and upgrade them.

It uses $HTTP_POST_VARS and session_register to pass session variables from one page to another after users log in to update the database (so every page that can update the database is secured). This works quite happily on my clients' servers (three or four are using the same basic log-in scripts.)

However, it does NOT work on the new xampp server on my laptop (vista).
I have tried a couple of log-in scripts on the new localhost and none of them work. I uploaded one of these to a client's server, and it did work. php 4.4.8, MySQL 4.1.22 on one, and php 5.3 on another server.

So what is stopping $HTTP_POST_VARS and session variables from being passed from page to page in my local xampp? Is there some part of the local configuration that needs to be changed?

I am definitely NOT an expert at configuring apache or php, and if I changed something on my older PC (before it died) that made these log-in pages work, I can't remember it, as it was four years ago that I did the work. I'm also not an expert on sessions, I just used some code from a text book that worked.
dr john
 
Posts: 2
Joined: 03. January 2010 14:57

Re: sessions not working

Postby Wiedmann » 03. January 2010 15:26

So what is stopping $HTTP_POST_VARS

I guess you want use $_POST and not $HTTP_POST_VARS.

and session variables from being passed from page to page

i don't know. Maybe a similar reason then above.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: sessions not working

Postby dr john » 03. January 2010 15:48

I've just tried replacing all instances of $HTTP_POST_VARS with $_SESSION, in one of the simpler scripts I had downloaded (they almost all use much the same methods).

And now it works.

I also used $_POST on the script that is the action for the log-in form, and that may have helped a bit.

I could echo $HTTP_POST_VARS on the action page, but not any others, so it was confusing that it seemed to have been set and then didn't pass on. Perhaps it needs to be set as a super variable somewhere in php.ini.
dr john
 
Posts: 2
Joined: 03. January 2010 14:57


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 38 guests