faqts : Computers : Programming : Languages : PHP : Common Problems : Sessions and State

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

15 of 28 people (54%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

I can not get sessions to work with IIS 4.0 and PHP 4.0 beta pl1 has anyone confirmed it to work? I haven't had any problems on linux.

Aug 4th, 2000 23:00
Strong Deng, Jerry Kagele, A solution from my friend.


The original c:\winnt\php.ini :
[Session]
session.save_handler      = files   ; handler used to store/retrieve 
data
session.save_path         = /tmp    ; argument passed to save_handler
                                    ; in the case of files, this is the
                                    ; path where data files are stored
session.use_cookies       = 1       ; whether to use cookies
session.name              = PHPSESSID  
                                    ; name of the session
                                    ; is used as cookie name
session.auto_start        = 0       ; initialize session on request 
startup
......
Please do as following:
1)Change the file of php.ini.
  Change session.save_path=/tmp to session.save_path= ;
  Change session.auto_start=0   to session.auto_start=1;
  ( or add the following statement at the beginning of all web pages.
    <?php
     session_start();
    ?>
  )
2)Restart IIS service.
3)$luck= "Good luck"; session_register("$luck");
4)$luck is now remembered on all your pages, and can be accessed by 
global $luck;

Good luck.

Strong