|
|||||||
| PHP Discussion and technical support for using and deploying PHP based websites. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
php.ini / session variables
I am working with session variables and can't seem to get them to work.
My code is as follows: <?php session_start(); ?> <html> <body> <?php $_SESSION['persist']="hello world"; echo $_SESSION['persist']; print_r($_SESSION); ?> <a href="page2.php">Page 2</a> </body> </html> which links to page2 <?php session_start(); ?> <html> <body> <?php $x= $_SESSION['persist']; echo $x; ?> <a href="page2.php">End</a> </body> </html> but page two does not have hello world. I changed the ini file upload_tmp_dir="C:\PHP\upload" session.save_path="C:\PHP\Sessions" as well as all of the other places where session.save.path is. and created the new directories and the sess vars still will not work! I checked the directories and it is not making session files with the session ID information either! Any help is much appreciated! K |
|
#2
|
|||
|
|||
|
Is there any error message ?
That will be helpful. |
|
#3
|
|||
|
|||
|
no error message...just doesn't show session var
|
|
#4
|
||||
|
||||
|
Run phpinfo() and check the local session save path is correct. Also check your browser doesn't have cookies disabled.
|
|
#5
|
|||
|
|||
|
ran phpinfo, file path correct, cookies enabled.
|
|
#6
|
|||
|
|||
|
does it matter where you put the directory for the session files? I put one in my php directory.
I'm using IIS...asp session variables work, but php doesn't. I checked the weblogs and IIS is creating a phpsessid but the files aren't showing up. Could IIS be the problem anyways? |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|