faqts : Computers : Programming : Languages : PHP : Installation and Setup : Sessions & Cookies

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

37 of 55 people (67%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

When I do a form submit with action PHP_SELF the session variables all disappear, why?

Mar 10th, 2002 23:15
Narendra Jain, Keith Scott,


When you submit the form, only the form variables are passed over and 
NOT the session variables. You have to exclusively pass the session 
variable PHPSESSID or else the entire data stored in the session 
variables will be lost.
In short the FORM would always look like:
  <FORM NAME=my_form METHOD=post 
        ACTION=<? echo $PHP_SELF?PHPSESSID=".$PHPSESSID ?> >