Solved

session_start() creates new session on page reload

Posted on 2008-06-20
25
2,963 Views
Last Modified: 2013-12-13
I have a lot of experience with php but this one is new on me. It seems that a new session is created everytime the session_start() function is accessed, even though we are still in the same session. I am using PHP 5.2.6 on Windows Vista Business 32-bit. To further complicate the issue, when I use $_SESSION variables in my script as well as $_COOKIE variables, it prevents me from setting more than one $_COOKIE and only shows the last one set. Any ideas? Thanks.
0
Comment
Question by:rbichon
  • 7
  • 7
  • 4
  • +3
25 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 21836663
how do you modify $_COOKIE. SOme cod would also be great to see (e.g. what happends before session_start() )
0
 
LVL 4

Expert Comment

by:afzz
ID: 21837017
try this. also check browser to see how many cookies you have from your domain. ie6/ie7 have a restriction of 20. check your system/server time too.
session_start();

if(!isset($_COOKIE['PHPSESSID']))

setcookie("PHPSESSID",session_id());

Open in new window

0
 
LVL 48

Expert Comment

by:hernst42
ID: 21837018
That is not needed and can have very strange effects. session_start() already sends out that cookie and upon first call and the cookie is not set. On the first request $_COOKIE[..] is always empty.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 21837190
Give us some sample code and the output of phpinfo() -- Also, run this and tell us what happens.
<?php

session_start();

if (isset($_POST[submit])) {

	if(!isset($_SESSION['cheese'])) {

		$_SESSION['cheese'] = 1;

	} else {

		$_SESSION['cheese']++;

	}

}

?>

<html><head><title>Session Test</title></head>

<body>

Current Session Variable value is: <?= $_SESSION['cheese'] ?> <br/>

<form method="post">

<input type=submit value=click name=submit>

</form>

</body>

</html>

Open in new window

0
 
LVL 11

Expert Comment

by:bansidhar
ID: 21837448
check if the folder defined by session.save_path in your php.ini exists and the web server has permission to read/write on this folder. Also check the web server error logs.
0
 
LVL 29

Expert Comment

by:fibo
ID: 21840783
Ray,
One side comment: your program may or may not return the right value for session variable!
It is guaranteed that this value will be updated when you leave the page, not that it is updated in the mean time.
0
 
LVL 29

Expert Comment

by:fibo
ID: 21840837
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 21840930
@fibo: Every time you click the submit button, you are "leaving" the page and it is reloaded with the new post data.  I've never seen a properly configured PHP installation that did not count up sequentially with that test case. ~Ray
0
 
LVL 1

Author Comment

by:rbichon
ID: 21865685
I think I nailed down a sequence that might help to explain the problem. If I run the script as I normally would, only the last cookie gets set and a new session file is created in the session directory every time the page loads. However, if I run another page first that only does a session_start() and then go to the desired page, everything works as it should. All cookies are set as they should be and it remembers session variables as well. Unfortunately, I cannot do a session_start on the test page and then a header redirect to the other page. I have to wait for the test page to finish and then go to the other page. Does any of this make sense?
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 21865809
rbichon, did you try the cheese script I posted?  What happened?

I can't quite figure out what may be happening from the post about the sequence, but here is what should be expected.

You do session_start() at the top of your script.  You are immediately able to load variables into $_SESSION.  They should be immediately present and useful in your script.  In the next script, you should also do session_start() at the top.  All of the previously loaded variables should be there.  To sum up, the session variable is instantaneously present.

That is NOT true of the $_COOKIE.  When you set a cookie, the cookie is not available until the next page load.

Please show us the output from phpinfo() and run the cheese script.  Thanks, ~Ray
0
 
LVL 29

Expert Comment

by:fibo
ID: 21865887
<<I cannot do a session_start on the test page and then a header redirect to the other page. I have to wait for the test page to finish and then go to the other page. Does any of this make sense?>>
Seems you are trying hard. This cannot work in any situation, since the session_start(), if followed directly by header... serves nothing (except keeping the session open). This does not solve any problem of session in a given page.
Before doing any other attempt, you really need to test the "cheese script"  from Ray. Then give us the result.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Comment

by:rbichon
ID: 21865958
When I get home I will try the cheese script. I can guarantee you though that it will fail to hold the value of the session variable just as it is in my other script. Remember, I have this script working without issue on another php build. I will also post the phpinfo results at that time.
0
 
LVL 29

Expert Comment

by:fibo
ID: 21866007
B-))
<<I can guarantee you >> I've so many grey hair that were caused by IT problems I guranted were working or not... that I prefer to say "I suspect" or "I fear"...
0
 
LVL 1

Author Comment

by:rbichon
ID: 21866050
I only guarantee it because I already tried something that was basically identical. If I was not able to guarantee this in such a basic script, I would not be worth very much as a programmer.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 21866053
Roger that!  Standing by.
0
 
LVL 1

Author Comment

by:rbichon
ID: 21969837
Sorry for the delay. When I run the cheese program, the first page reads:
Current Session Variable value is:
When I click submit, it increments starting at 1. Here is the phpinfo()



PHP Version 5.2.6

System Windows NT TR-VISTA1 6.0 build 6001
Build Date May 2 2008 18:01:20
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared" "--with-extra-includes=C:\Program Files (x86)\Microsoft SDK\Include;C:\PROGRA~2\MICROS~2\VC98\ATL\INCLUDE;C:\PROGRA~2\MICROS~2\VC98\INCLUDE;C:\PROGRA~2\MICROS~2\VC98\MFC\INCLUDE" "--with-extra-libs=C:\Program Files (x86)\Microsoft SDK\Lib;C:\PROGRA~2\MICROS~2\VC98\LIB;C:\PROGRA~2\MICROS~2\VC98\MFC\LIB"
Server API CGI/FastCGI
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\php\php.ini
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies





PHP Credits



Configuration
PHP Core
DirectiveLocal ValueMaster Value
allow_call_time_pass_referenceOnOn
allow_url_fopenOnOn
allow_url_includeOffOff
always_populate_raw_post_dataOffOff
arg_separator.input&&
arg_separator.output&&
asp_tagsOffOff
auto_append_fileno valueno value
auto_globals_jitOnOn
auto_prepend_fileno valueno value
browscapno valueno value
default_charsetno valueno value
default_mimetypetext/htmltext/html
define_syslog_variablesOffOff
disable_classesno valueno value
disable_functionsno valueno value
display_errorsOnOn
display_startup_errorsOffOff
doc_rootno valueno value
docref_extno valueno value
docref_rootno valueno value
enable_dlOnOn
error_append_stringno valueno value
error_logno valueno value
error_prepend_stringno valueno value
error_reporting61356135
expose_phpOnOn
extension_dir./ext/./ext/
file_uploadsOnOn
highlight.bg#FFFFFF#FFFFFF
highlight.comment#FF8000#FF8000
highlight.default#0000BB#0000BB
highlight.html#000000#000000
highlight.keyword#007700#007700
highlight.string#DD0000#DD0000
html_errorsOnOn
ignore_repeated_errorsOffOff
ignore_repeated_sourceOffOff
ignore_user_abortOffOff
implicit_flushOffOff
include_path.;C:\php5\pear.;C:\php5\pear
log_errorsOffOff
log_errors_max_len10241024
magic_quotes_gpcOnOn
magic_quotes_runtimeOffOff
magic_quotes_sybaseOffOff
mail.force_extra_parametersno valueno value
max_execution_time3030
max_input_nesting_level6464
max_input_time6060
memory_limit128M128M
open_basedirno valueno value
output_bufferingno valueno value
output_handlerno valueno value
post_max_size8M8M
precision1212
realpath_cache_size16K16K
realpath_cache_ttl120120
register_argc_argvOnOn
register_globalsOffOff
register_long_arraysOnOn
report_memleaksOnOn
report_zend_debugOnOn
safe_modeOffOff
safe_mode_exec_dirno valueno value
safe_mode_gidOffOff
safe_mode_include_dirno valueno value
sendmail_fromno valueno value
sendmail_pathno valueno value
serialize_precision100100
short_open_tagOnOn
SMTPlocalhostlocalhost
smtp_port2525
sql.safe_modeOffOff
track_errorsOffOff
unserialize_callback_funcno valueno value
upload_max_filesize2M2M
upload_tmp_dirno valueno value
user_dirno valueno value
variables_orderEGPCSEGPCS
xmlrpc_error_number00
xmlrpc_errorsOffOff
y2k_complianceOnOn
zend.ze1_compatibility_modeOffOff


bcmath
BCMath support enabled


calendar
Calendar support enabled


cgi-fcgi
DirectiveLocal ValueMaster Value
cgi.check_shebang_line11
cgi.fix_pathinfo11
cgi.force_redirect00
cgi.nph00
cgi.redirect_status_envno valueno value
cgi.rfc2616_headers00
fastcgi.impersonate00
fastcgi.logging11


com_dotnet
COM supportenabled
DCOM supportdisabled
.Net supportenabled

DirectiveLocal ValueMaster Value
com.allow_dcom00
com.autoregister_casesensitive11
com.autoregister_typelib00
com.autoregister_verbose00
com.code_pageno valueno value
com.typelib_fileno valueno value


ctype
ctype functions enabled


curl
cURL support enabled
cURL Information libcurl/7.16.0 OpenSSL/0.9.8g zlib/1.2.3


date
date/time support enabled
"Olson" Timezone Database Version 2008.2
Timezone Database internal
Default timezone America/New_York

DirectiveLocal ValueMaster Value
date.default_latitude31.766731.7667
date.default_longitude35.233335.2333
date.sunrise_zenith90.58333390.583333
date.sunset_zenith90.58333390.583333
date.timezoneno valueno value


dom
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.6.32
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled


filter
Input Validation and Filtering enabled
Revision $Revision: 1.52.2.42 $

DirectiveLocal ValueMaster Value
filter.defaultunsafe_rawunsafe_raw
filter.default_flagsno valueno value


ftp
FTP support enabled


hash
hash support enabled
Hashing Engines md2 md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5


iconv
iconv support enabled
iconv implementation "libiconv"
iconv library version 1.11

DirectiveLocal ValueMaster Value
iconv.input_encodingISO-8859-1ISO-8859-1
iconv.internal_encodingISO-8859-1ISO-8859-1
iconv.output_encodingISO-8859-1ISO-8859-1


json
json support enabled
json version 1.2.1


libxml
libXML support active
libXML Version 2.6.32
libXML streams enabled


mbstring
Multibyte Support enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

DirectiveLocal ValueMaster Value
mbstring.detect_orderno valueno value
mbstring.encoding_translationOffOff
mbstring.func_overload00
mbstring.http_inputpasspass
mbstring.http_outputpasspass
mbstring.internal_encodingISO-8859-1no value
mbstring.languageneutralneutral
mbstring.strict_detectionOffOff
mbstring.substitute_characterno valueno value


mysql
MySQL Supportenabled
Active Persistent Links 0
Active Links 0
Client API version 5.0.51a

DirectiveLocal ValueMaster Value
mysql.allow_persistentOnOn
mysql.connect_timeout6060
mysql.default_hostno valueno value
mysql.default_passwordno valueno value
mysql.default_portno valueno value
mysql.default_socketno valueno value
mysql.default_userno valueno value
mysql.max_linksUnlimitedUnlimited
mysql.max_persistentUnlimitedUnlimited
mysql.trace_modeOffOff


mysqli
MysqlI Supportenabled
Client API library version 5.0.51a
Client API header version 5.0.51a
MYSQLI_SOCKET /tmp/mysql.sock

DirectiveLocal ValueMaster Value
mysqli.default_hostno valueno value
mysqli.default_port33063306
mysqli.default_pwno valueno value
mysqli.default_socketno valueno value
mysqli.default_userno valueno value
mysqli.max_linksUnlimitedUnlimited
mysqli.reconnectOffOff


odbc
ODBC Supportenabled
Active Persistent Links 0
Active Links 0
ODBC library Win32

DirectiveLocal ValueMaster Value
odbc.allow_persistentOnOn
odbc.check_persistentOnOn
odbc.default_dbno valueno value
odbc.default_pwno valueno value
odbc.default_userno valueno value
odbc.defaultbinmodereturn as isreturn as is
odbc.defaultlrlreturn up to 4096 bytesreturn up to 4096 bytes
odbc.max_linksUnlimitedUnlimited
odbc.max_persistentUnlimitedUnlimited


pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 7.6 2008-01-28

DirectiveLocal ValueMaster Value
pcre.backtrack_limit100000100000
pcre.recursion_limit100000100000


Reflection
Reflectionenabled
Version $Id: php_reflection.c,v 1.164.2.33.2.50 2008/03/13 15:56:21 iliaa Exp $


session
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx

DirectiveLocal ValueMaster Value
session.auto_startOffOff
session.bug_compat_42OnOn
session.bug_compat_warnOnOn
session.cache_expire180180
session.cache_limiternocachenocache
session.cookie_domainno valueno value
session.cookie_httponlyOffOff
session.cookie_lifetime00
session.cookie_path//
session.cookie_secureOffOff
session.entropy_fileno valueno value
session.entropy_length00
session.gc_divisor100100
session.gc_maxlifetime14401440
session.gc_probability11
session.hash_bits_per_character44
session.hash_function00
session.namePHPSESSIDPHPSESSID
session.referer_checkno valueno value
session.save_handlerfilesfiles
session.save_pathC:\php\sessiondataC:\php\sessiondata
session.serialize_handlerphpphp
session.use_cookiesOnOn
session.use_only_cookiesOffOff
session.use_trans_sid00


SimpleXML
Simplexml supportenabled
Revision $Revision: 1.151.2.22.2.39 $
Schema support enabled


SPL
SPL supportenabled
Interfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RegexIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueException


standard
Regex Library Bundled library enabled
Dynamic Library Support enabled
Internal Sendmail Support for Windows enabled

DirectiveLocal ValueMaster Value
assert.active11
assert.bail00
assert.callbackno valueno value
assert.quiet_eval00
assert.warning11
auto_detect_line_endings00
default_socket_timeout6060
safe_mode_allowed_env_varsPHP_PHP_
safe_mode_protected_env_varsLD_LIBRARY_PATHLD_LIBRARY_PATH
url_rewriter.tagsa=href,area=href,frame=src,input=src,form=,fieldset=a=href,area=href,frame=src,input=src,form=,fieldset=
user_agentno valueno value


tokenizer
Tokenizer Support enabled


wddx
WDDX Supportenabled
WDDX Session Serializer enabled


xml
XML Support active
XML Namespace Support active
libxml2 Version 2.6.32


xmlreader
XMLReader enabled


xmlwriter
XMLWriter enabled


zlib
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.3
Linked Version 1.2.3

DirectiveLocal ValueMaster Value
zlib.output_compressionOffOff
zlib.output_compression_level-1-1
zlib.output_handlerno valueno value


Additional Modules
Module Name


Environment
VariableValue
ALLUSERSPROFILE C:\ProgramData
APPDATA C:\Windows\system32\config\systemprofile\AppData\Roaming
APP_POOL_ID DefaultAppPool
CLASSPATH .;C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
CommonProgramFiles C:\Program Files\Common Files
COMPUTERNAME TR-VISTA1
ComSpec C:\Windows\system32\cmd.exe
DEFLOGDIR C:\ProgramData\McAfee\DesktopProtection
FP_NO_HOST_CHECK NO
LOCALAPPDATA C:\Windows\system32\config\systemprofile\AppData\Local
NUMBER_OF_PROCESSORS 4
OS Windows_NT
Path C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;C:\php;C:\Program Files\QuickTime\QTSystem\
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE x86
PROCESSOR_IDENTIFIER x86 Family 6 Model 15 Stepping 7, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 0f07
ProgramData C:\ProgramData
ProgramFiles C:\Program Files
PUBLIC C:\Users\Public
QTJAVA C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
SystemDrive C:
SystemRoot C:\Windows
TEMP C:\Windows\TEMP
TMP C:\Windows\TEMP
USERDOMAIN WORKGROUP
USERNAME TR-VISTA1$
USERPROFILE C:\Windows\system32\config\systemprofile
VS80COMNTOOLS C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
VSEDEFLOGDIR C:\ProgramData\McAfee\DesktopProtection
windir C:\Windows
HTTP_CONNECTION Keep-Alive
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE en-us
HTTP_COOKIE PHPSESSID=ca90056e2b1697a4e6881e1a0b375417
HTTP_HOST 192.168.1.50
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)
HTTP_UA_CPU x86
APP_POOL_ID DefaultAppPool
AUTH_TYPE no value
AUTH_PASSWORD no value
AUTH_USER no value
CERT_COOKIE no value
CERT_FLAGS no value
CERT_ISSUER no value
CERT_SERIALNUMBER no value
CERT_SUBJECT no value
CONTENT_LENGTH 0
CONTENT_TYPE no value
GATEWAY_INTERFACE CGI/1.1
HTTPS off
HTTPS_KEYSIZE no value
HTTPS_SECRETKEYSIZE no value
HTTPS_SERVER_ISSUER no value
HTTPS_SERVER_SUBJECT no value
INSTANCE_ID 1
LOCAL_ADDR 192.168.1.50
LOGON_USER no value
PATH_TRANSLATED C:\inetpub\wwwroot\test.php
QUERY_STRING no value
REMOTE_ADDR 192.168.1.50
REMOTE_HOST 192.168.1.50
REMOTE_USER no value
REQUEST_METHOD GET
SCRIPT_NAME /test.php
SERVER_NAME 192.168.1.50
SERVER_PORT 80
SERVER_PORT_SECURE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/7.0
UNMAPPED_REMOTE_USER no value
ORIG_PATH_INFO /test.php
SCRIPT_FILENAME C:\inetpub\wwwroot\test.php


PHP Variables
VariableValue
_REQUEST["PHPSESSID"]ca90056e2b1697a4e6881e1a0b375417
_COOKIE["PHPSESSID"]ca90056e2b1697a4e6881e1a0b375417
_SERVER["ALLUSERSPROFILE"]C:\ProgramData
_SERVER["APPDATA"]C:\Windows\system32\config\systemprofile\AppData\Roaming
_SERVER["APP_POOL_ID"]DefaultAppPool
_SERVER["CLASSPATH"].;C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
_SERVER["CommonProgramFiles"]C:\Program Files\Common Files
_SERVER["COMPUTERNAME"]TR-VISTA1
_SERVER["ComSpec"]C:\Windows\system32\cmd.exe
_SERVER["DEFLOGDIR"]C:\ProgramData\McAfee\DesktopProtection
_SERVER["FP_NO_HOST_CHECK"]NO
_SERVER["LOCALAPPDATA"]C:\Windows\system32\config\systemprofile\AppData\Local
_SERVER["NUMBER_OF_PROCESSORS"]4
_SERVER["OS"]Windows_NT
_SERVER["Path"]C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;C:\php;C:\Program Files\QuickTime\QTSystem\
_SERVER["PATHEXT"].COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
_SERVER["PROCESSOR_ARCHITECTURE"]x86
_SERVER["PROCESSOR_IDENTIFIER"]x86 Family 6 Model 15 Stepping 7, GenuineIntel
_SERVER["PROCESSOR_LEVEL"]6
_SERVER["PROCESSOR_REVISION"]0f07
_SERVER["ProgramData"]C:\ProgramData
_SERVER["ProgramFiles"]C:\Program Files
_SERVER["PUBLIC"]C:\Users\Public
_SERVER["QTJAVA"]C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
_SERVER["SystemDrive"]C:
_SERVER["SystemRoot"]C:\Windows
_SERVER["TEMP"]C:\Windows\TEMP
_SERVER["TMP"]C:\Windows\TEMP
_SERVER["USERDOMAIN"]WORKGROUP
_SERVER["USERNAME"]TR-VISTA1$
_SERVER["USERPROFILE"]C:\Windows\system32\config\systemprofile
_SERVER["VS80COMNTOOLS"]C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
_SERVER["VSEDEFLOGDIR"]C:\ProgramData\McAfee\DesktopProtection
_SERVER["windir"]C:\Windows
_SERVER["HTTP_CONNECTION"]Keep-Alive
_SERVER["HTTP_ACCEPT"]image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
_SERVER["HTTP_ACCEPT_ENCODING"]gzip, deflate
_SERVER["HTTP_ACCEPT_LANGUAGE"]en-us
_SERVER["HTTP_COOKIE"]PHPSESSID=ca90056e2b1697a4e6881e1a0b375417
_SERVER["HTTP_HOST"]192.168.1.50
_SERVER["HTTP_USER_AGENT"]Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)
_SERVER["HTTP_UA_CPU"]x86
_SERVER["AUTH_TYPE"]no value
_SERVER["AUTH_PASSWORD"]no value
_SERVER["AUTH_USER"]no value
_SERVER["CERT_COOKIE"]no value
_SERVER["CERT_FLAGS"]no value
_SERVER["CERT_ISSUER"]no value
_SERVER["CERT_SERIALNUMBER"]no value
_SERVER["CERT_SUBJECT"]no value
_SERVER["CONTENT_LENGTH"]0
_SERVER["CONTENT_TYPE"]no value
_SERVER["GATEWAY_INTERFACE"]CGI/1.1
_SERVER["HTTPS"]off
_SERVER["HTTPS_KEYSIZE"]no value
_SERVER["HTTPS_SECRETKEYSIZE"]no value
_SERVER["HTTPS_SERVER_ISSUER"]no value
_SERVER["HTTPS_SERVER_SUBJECT"]no value
_SERVER["INSTANCE_ID"]1
_SERVER["LOCAL_ADDR"]192.168.1.50
_SERVER["LOGON_USER"]no value
_SERVER["PATH_TRANSLATED"]C:\inetpub\wwwroot\test.php
_SERVER["QUERY_STRING"]no value
_SERVER["REMOTE_ADDR"]192.168.1.50
_SERVER["REMOTE_HOST"]192.168.1.50
_SERVER["REMOTE_USER"]no value
_SERVER["REQUEST_METHOD"]GET
_SERVER["SCRIPT_NAME"]/test.php
_SERVER["SERVER_NAME"]192.168.1.50
_SERVER["SERVER_PORT"]80
_SERVER["SERVER_PORT_SECURE"]0
_SERVER["SERVER_PROTOCOL"]HTTP/1.1
_SERVER["SERVER_SOFTWARE"]Microsoft-IIS/7.0
_SERVER["UNMAPPED_REMOTE_USER"]no value
_SERVER["ORIG_PATH_INFO"]/test.php
_SERVER["SCRIPT_FILENAME"]C:\inetpub\wwwroot\test.php
_SERVER["PHP_SELF"]/test.php
_SERVER["REQUEST_TIME"]1215654978
_SERVER["argv"]Array
(
)


_SERVER["argc"]0
_ENV["ALLUSERSPROFILE"]C:\ProgramData
_ENV["APPDATA"]C:\Windows\system32\config\systemprofile\AppData\Roaming
_ENV["APP_POOL_ID"]DefaultAppPool
_ENV["CLASSPATH"].;C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
_ENV["CommonProgramFiles"]C:\Program Files\Common Files
_ENV["COMPUTERNAME"]TR-VISTA1
_ENV["ComSpec"]C:\Windows\system32\cmd.exe
_ENV["DEFLOGDIR"]C:\ProgramData\McAfee\DesktopProtection
_ENV["FP_NO_HOST_CHECK"]NO
_ENV["LOCALAPPDATA"]C:\Windows\system32\config\systemprofile\AppData\Local
_ENV["NUMBER_OF_PROCESSORS"]4
_ENV["OS"]Windows_NT
_ENV["Path"]C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;C:\php;C:\Program Files\QuickTime\QTSystem\
_ENV["PATHEXT"].COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
_ENV["PROCESSOR_ARCHITECTURE"]x86
_ENV["PROCESSOR_IDENTIFIER"]x86 Family 6 Model 15 Stepping 7, GenuineIntel
_ENV["PROCESSOR_LEVEL"]6
_ENV["PROCESSOR_REVISION"]0f07
_ENV["ProgramData"]C:\ProgramData
_ENV["ProgramFiles"]C:\Program Files
_ENV["PUBLIC"]C:\Users\Public
_ENV["QTJAVA"]C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
_ENV["SystemDrive"]C:
_ENV["SystemRoot"]C:\Windows
_ENV["TEMP"]C:\Windows\TEMP
_ENV["TMP"]C:\Windows\TEMP
_ENV["USERDOMAIN"]WORKGROUP
_ENV["USERNAME"]TR-VISTA1$
_ENV["USERPROFILE"]C:\Windows\system32\config\systemprofile
_ENV["VS80COMNTOOLS"]C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
_ENV["VSEDEFLOGDIR"]C:\ProgramData\McAfee\DesktopProtection
_ENV["windir"]C:\Windows
_ENV["HTTP_CONNECTION"]Keep-Alive
_ENV["HTTP_ACCEPT"]image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
_ENV["HTTP_ACCEPT_ENCODING"]gzip, deflate
_ENV["HTTP_ACCEPT_LANGUAGE"]en-us
_ENV["HTTP_COOKIE"]PHPSESSID=ca90056e2b1697a4e6881e1a0b375417
_ENV["HTTP_HOST"]192.168.1.50
_ENV["HTTP_USER_AGENT"]Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)
_ENV["HTTP_UA_CPU"]x86
_ENV["AUTH_TYPE"]no value
_ENV["AUTH_PASSWORD"]no value
_ENV["AUTH_USER"]no value
_ENV["CERT_COOKIE"]no value
_ENV["CERT_FLAGS"]no value
_ENV["CERT_ISSUER"]no value
_ENV["CERT_SERIALNUMBER"]no value
_ENV["CERT_SUBJECT"]no value
_ENV["CONTENT_LENGTH"]0
_ENV["CONTENT_TYPE"]no value
_ENV["GATEWAY_INTERFACE"]CGI/1.1
_ENV["HTTPS"]off
_ENV["HTTPS_KEYSIZE"]no value
_ENV["HTTPS_SECRETKEYSIZE"]no value
_ENV["HTTPS_SERVER_ISSUER"]no value
_ENV["HTTPS_SERVER_SUBJECT"]no value
_ENV["INSTANCE_ID"]1
_ENV["LOCAL_ADDR"]192.168.1.50
_ENV["LOGON_USER"]no value
_ENV["PATH_TRANSLATED"]C:\inetpub\wwwroot\test.php
_ENV["QUERY_STRING"]no value
_ENV["REMOTE_ADDR"]192.168.1.50
_ENV["REMOTE_HOST"]192.168.1.50
_ENV["REMOTE_USER"]no value
_ENV["REQUEST_METHOD"]GET
_ENV["SCRIPT_NAME"]/test.php
_ENV["SERVER_NAME"]192.168.1.50
_ENV["SERVER_PORT"]80
_ENV["SERVER_PORT_SECURE"]0
_ENV["SERVER_PROTOCOL"]HTTP/1.1
_ENV["SERVER_SOFTWARE"]Microsoft-IIS/7.0
_ENV["UNMAPPED_REMOTE_USER"]no value
_ENV["ORIG_PATH_INFO"]/test.php
_ENV["SCRIPT_FILENAME"]C:\inetpub\wwwroot\test.php


PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
0
 
LVL 11

Expert Comment

by:bansidhar
ID: 21971289
Your session seems to be working perfectly, because you got the exact expected result of the cheese  program.
You may have to check your program which is creating the problem.
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 21972716
I can see nothing in PHPINFO that would be causing the trouble, and the cheese script works, so I would say that the session variables are being handled correctly.  I suspect there is an issue in the programs.  Please post the code that is failing and we can have a look at the logic flow.  Perhaps we can spot something.  ~Ray
0
 
LVL 1

Author Comment

by:rbichon
ID: 22042658
Again, this exact script works on another windows machine...can't be the code.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 22042881
RBichon: Are you being facetious when you say, "can't be the code." ??

Earlier when we asked you to run a test script you wrote, "I can guarantee you though that it will fail..." and no failure occurred; in fact the script worked just as it should.

We can only help if you cooperate and are willing to accept help.  That's why we asked you to post the code of the programs that are failing.  Yet you didn't post the code, then you gave my effort to help you a grade of "C."  That's pretty lame.
0
 
LVL 1

Author Comment

by:rbichon
ID: 22042910
I wasn't asking for code advice. Tell me, can you think of any reason why code would work on one machine and not the other? My code is private and I can troubleshoot it myself.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 22043345
Sure.  Data dependent logic that encounters different data on one machine and not the other.  But you already knew that.
0
 
LVL 1

Author Comment

by:rbichon
ID: 22043377
I did say identical, didn't I?
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now