Need HELP on Sessions

I am using PHP5, MySQL5.0, IIS Server, Dreamweaver. I had done a login page, checklogin page and a result page. The result page says hello to the user who log in.

I managed to captured the username and put it into $_SESSION[‘user’] and I managed to print the username out on that page. However, after redirecting from checklogin page to test page (using header), the $_SESSION[‘user’] seems to be empty.

I already made sure that i placed session_start() on top of all the codes in checklogin page and result page.

Can anyone tell me how come the session ahs become empty after redirecting?

Can you post what you have in your test page?

Checklogin page

<?php session_start(); error_reporting(E_ALL); ini_set ("display_errors", "1"); $_SESSION['user']='John'; print_r($_SESSION); //header("Location: ./test.php"); ?>

I have this error:
Array ( [user] => John )
Warning: Unknown: open(C:DOCUME~1ADMINI~1LOCALS~1Tempphpsessio nsess_q4r6uf52v0k675pc1d5us8gl34, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:DOCUME~1ADMINI~1LOCALS~1Tempphpsession) in Unknown on line 0

Can anyone tell me wat happened?

try this…

<?php session_start(); session_register('user'); error_reporting(E_ALL); ini_set ("display_errors", "1"); $_SESSION['user']='John'; print_r($_SESSION); //header("Location: ./test.php"); //header("Location:test.php"); ?>

Not sure…

the error message said it all.

navigate to the folder C:DOCUME~1ADMINI~1LOCALS~1Tempphpsession
and make sure it is existing and that ur http-server has write permisions on that folder.

Sponsor our Newsletter | Privacy Policy | Terms of Service