[PHP] Re: sessions not working when page redirects

2004-08-10 Thread pete M
u need to start the session at the top of each page
sesion_start();
Angelo Zanetti wrote:
Hi all, 

Im having a slightly weird problem with my session variables. when on a
certain page call it A, I register a session variable and assign it a
value. I then test if it is registered successfully and has the correct
value on the same page, that works no problem. After that page A
redirects to page B:
header(Location: ../admin/include/B.php);
After this I do the exact same test on page B to test for successful
registration and value and I get that the session variable is not
registered. on page B I do have session_start(); at the top. I even do
2 tests to on the session variable:
if (session_is_registered(myvar))
and 

if (isset($_SESSION[myvar])) 

and they both tell me that the session variable is not registered. what
could be causing the sesssion variable not to be remembered from page to
page. I am using register_globals=on;
any ideas/comments?
Thanks
Angelo

Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: sessions not working when page redirects

2004-08-10 Thread Angelo Zanetti
I do do that on all pages...



 pete M [EMAIL PROTECTED] 8/10/2004 2:15:21 PM 
u need to start the session at the top of each page
sesion_start();


Angelo Zanetti wrote:
 Hi all, 
 
 Im having a slightly weird problem with my session variables. when on
a
 certain page call it A, I register a session variable and assign it
a
 value. I then test if it is registered successfully and has the
correct
 value on the same page, that works no problem. After that page A
 redirects to page B:
 
 header(Location: ../admin/include/B.php);
 
 After this I do the exact same test on page B to test for
successful
 registration and value and I get that the session variable is not
 registered. on page B I do have session_start(); at the top. I even
do
 2 tests to on the session variable:
 
 if (session_is_registered(myvar))
 
 and 
 
 if (isset($_SESSION[myvar])) 
 
 and they both tell me that the session variable is not registered.
what
 could be causing the sesssion variable not to be remembered from page
to
 page. I am using register_globals=on;
 
 any ideas/comments?
 Thanks
 Angelo
 
 Disclaimer 
 This e-mail transmission contains confidential information,
 which is the property of the sender.
 The information in this e-mail or attachments thereto is 
 intended for the attention and use only of the addressee. 
 Should you have received this e-mail in error, please delete 
 and destroy it and any attachments thereto immediately. 
 Under no circumstances will the Cape Technikon or the sender 
 of this e-mail be liable to any party for any direct, indirect, 
 special or other consequential damages for any use of this e-mail.
 For the detailed e-mail disclaimer please refer to 
 http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Sessions not working.

2004-02-01 Thread The.Rock
If your on IIS, you need to set the session.save_path option in php.ini
file. Then make sure that IIS can actually write to the directory.

Jeff McKeon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Pulling my hair out here.

I've got an IIS5 webserver running a php website just fine.

I created another web for a dev version of the first website.  Installed
PHP ect...
When I load up the old websites files on the new site sessions won't
work on the new site.

For some reason on the new site's phpinfo.php page, there is no
HTTP_COOKIE variable set under the environmental section.

Also, under the PHP Variables section, there is no _REQUEST[PHPSESSID]
or _COOKIE[PHPSESSID] variable.

What have I missed!???

Here is a section of the phpinfo() for both sites.

Good Site:

Environment
Variable Value
ALLUSERSPROFILE  C:\Documents and Settings\All Users
CommonProgramFiles  C:\Program Files\Common Files
COMPUTERNAME  WS02TC07927
ComSpec  C:\WINNT\system32\cmd.exe
CONTENT_LENGTH  0
GATEWAY_INTERFACE  CGI/1.1
HTTPS  off
HTTP_ACCEPT  */*
HTTP_ACCEPT_LANGUAGE  en-us
HTTP_CONNECTION  Keep-Alive
HTTP_HOST  opsup.telaurus.net
HTTP_USER_AGENT  Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
HTTP_COOKIE  PHPSESSID=ed09aa7b20d4032a3553c16a8f4a782f
HTTP_ACCEPT_ENCODING  gzip, deflate
INSTANCE_ID  3
LOCAL_ADDR  10.16.1.21
NUMBER_OF_PROCESSORS  1
Os2LibPath  C:\WINNT\system32\os2\dll;
OS  Windows_NT
Path  C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
PATHEXT  .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PATH_INFO  /phpinfo.php
PATH_TRANSLATED  C:\Inetpub\wwwOpSup\phpinfo.php
PROCESSOR_ARCHITECTURE  x86
PROCESSOR_IDENTIFIER  x86 Family 6 Model 8 Stepping 10, GenuineIntel
PROCESSOR_LEVEL  6
PROCESSOR_REVISION  080a
ProgramFiles  C:\Program Files
REMOTE_ADDR  10.16.2.55
REMOTE_HOST  10.16.2.55
REQUEST_METHOD  GET
SCRIPT_NAME  /phpinfo.php
SERVER_NAME  opsup.telaurus.net
SERVER_PORT  80
SERVER_PORT_SECURE  0
SERVER_PROTOCOL  HTTP/1.1
SERVER_SOFTWARE  Microsoft-IIS/5.0
SystemDrive  C:
SystemRoot  C:\WINNT
TEMP  C:\WINNT\TEMP
TMP  C:\WINNT\TEMP
USERPROFILE  C:\Documents and Settings\NetShowServices
windir  C:\WINNT


PHP Variables
Variable Value
_REQUEST[PHPSESSID] ed09aa7b20d4032a3553c16a8f4a782f
_COOKIE[PHPSESSID] ed09aa7b20d4032a3553c16a8f4a782f
_SERVER[ALLUSERSPROFILE] C:\\Documents and Settings\\All Users
_SERVER[CommonProgramFiles] C:\\Program Files\\Common Files
_SERVER[COMPUTERNAME] WS02TC07927
_SERVER[ComSpec] C:\\WINNT\\system32\\cmd.exe
_SERVER[CONTENT_LENGTH] 0
_SERVER[GATEWAY_INTERFACE] CGI/1.1
_SERVER[HTTPS] off
_SERVER[HTTP_ACCEPT] */*
_SERVER[HTTP_ACCEPT_LANGUAGE] en-us
_SERVER[HTTP_CONNECTION] Keep-Alive
_SERVER[HTTP_HOST] opsup.telaurus.net
_SERVER[HTTP_USER_AGENT] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1)
_SERVER[HTTP_COOKIE] PHPSESSID=ed09aa7b20d4032a3553c16a8f4a782f
_SERVER[HTTP_ACCEPT_ENCODING] gzip, deflate
_SERVER[INSTANCE_ID] 3
_SERVER[LOCAL_ADDR] 10.16.1.21
_SERVER[NUMBER_OF_PROCESSORS] 1
_SERVER[Os2LibPath] C:\\WINNT\\system32\\os2\\dll;
_SERVER[OS] Windows_NT
_SERVER[Path] C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem
_SERVER[PATHEXT] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_SERVER[PATH_INFO] /phpinfo.php
_SERVER[PATH_TRANSLATED] C:\\Inetpub\\wwwOpSup\\phpinfo.php
_SERVER[PROCESSOR_ARCHITECTURE] x86
_SERVER[PROCESSOR_IDENTIFIER] x86 Family 6 Model 8 Stepping 10,
GenuineIntel
_SERVER[PROCESSOR_LEVEL] 6
_SERVER[PROCESSOR_REVISION] 080a
_SERVER[ProgramFiles] C:\\Program Files
_SERVER[REMOTE_ADDR] 10.16.2.55
_SERVER[REMOTE_HOST] 10.16.2.55
_SERVER[REQUEST_METHOD] GET
_SERVER[SCRIPT_NAME] /phpinfo.php
_SERVER[SERVER_NAME] opsup.telaurus.net
_SERVER[SERVER_PORT] 80
_SERVER[SERVER_PORT_SECURE] 0
_SERVER[SERVER_PROTOCOL] HTTP/1.1
_SERVER[SERVER_SOFTWARE] Microsoft-IIS/5.0
_SERVER[SystemDrive] C:
_SERVER[SystemRoot] C:\\WINNT
_SERVER[TEMP] C:\\WINNT\\TEMP
_SERVER[TMP] C:\\WINNT\\TEMP
_SERVER[USERPROFILE] C:\\Documents and Settings\\NetShowServices
_SERVER[windir] C:\\WINNT
_SERVER[PHP_SELF] /phpinfo.php
_SERVER[argv] Array
(
)

_SERVER[argc] 0
_ENV[ALLUSERSPROFILE] C:\\Documents and Settings\\All Users
_ENV[CommonProgramFiles] C:\\Program Files\\Common Files
_ENV[COMPUTERNAME] WS02TC07927
_ENV[ComSpec] C:\\WINNT\\system32\\cmd.exe
_ENV[CONTENT_LENGTH] 0
_ENV[GATEWAY_INTERFACE] CGI/1.1
_ENV[HTTPS] off
_ENV[HTTP_ACCEPT] */*
_ENV[HTTP_ACCEPT_LANGUAGE] en-us
_ENV[HTTP_CONNECTION] Keep-Alive
_ENV[HTTP_HOST] opsup.telaurus.net
_ENV[HTTP_USER_AGENT] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1)
_ENV[HTTP_COOKIE] PHPSESSID=ed09aa7b20d4032a3553c16a8f4a782f
_ENV[HTTP_ACCEPT_ENCODING] gzip, deflate
_ENV[INSTANCE_ID] 3
_ENV[LOCAL_ADDR] 10.16.1.21
_ENV[NUMBER_OF_PROCESSORS] 1
_ENV[Os2LibPath] C:\\WINNT\\system32\\os2\\dll;
_ENV[OS] Windows_NT
_ENV[Path] C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem
_ENV[PATHEXT] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_ENV[PATH_INFO] /phpinfo.php
_ENV[PATH_TRANSLATED] C:\\Inetpub\\wwwOpSup\\phpinfo.php

[PHP] RE: Sessions not working between documents (was: Sessions and switching between php and htm documents)

2002-02-27 Thread Cal Evans

When you check your info page, do sessions automatically start? If not, make
sure you do a session_start(); in there somewhere before you start checking
things.

Not sure why (lost in the annuls of time) but I always manually start/stop
my sessions.

=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 8:10 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Sessions not working between documents (was: Sessions and
switching between php and htm documents)


further to this...

--enable-track-vars --enable-trans-sid are both set in the build...
using mod_php
register globals is on


-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 8:47 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions and switching between php and htm documents


tested the $HTTP_SESSION_VARS prior to sending, set just fine.
changed the next page to php and tested for the session var...  nothing.

[in login.php]
?
session_start();
# database check in here
if(match){ 
   $HTTP_SESSION_VARS[UserID_session]=$txtUserID; #from form 
field for user
   $HTTP_SESSION_VARS[UserNum_session]=$databaseresult; # from 
database result for user number
   header(Location: successlogin.php); # or .htm - changed this 
to test if var was being passed
   exit;
}else{ 
   header(Location: wrongpassword.htm);
   exit;
} 
?

[in successlogin.php]
?
echo $HTTP_SESSION_VARS[SellerID_session];
?

if I check session_id() - it is the same in both pages.  Variables 
just aren't getting stored/retrieved.

ideas?

as an aside, how do you destroy/start a new session with new session 
id?  or do you just destroy the variables then use the same session id 
for the new session?

Dave

Did you test and make sure the variable is set?
login.php
  session_start();
  $HTTP_SESSION_VARS[username]=$formUserName;
  echo $HTTP_SESSION_VARS[username]
  header(Location: displaypage.htm);

Also, for grins ang giggles, make the middle page in the chain a HP, start
the session and test for the variable.  If it does not work then the problem
is not the middle page being html.


Subject: [PHP] Sessions and switching between php and htm documents


login.htm
  form submits information

login.php
  session_start();
  $HTTP_SESSION_VARS[username]=$formUserName;
  header(Location: displaypage.htm);

displaypage.htm
  show some static stuff
  links to formpage.htm

formpage.htm
  form submits information to form.php

form.php
  session_start();
  echo $HTTP_SESSION_VARS[username];  -  has no value






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php