NYCPHP Meetup

NYPHP.org

[nycphp-talk] $_SESSION

Malcolm, Gary gmalcolm at professionalcredit.com
Thu May 8 16:13:25 EDT 2003


i suggest not using regiser...
just change the $_SESSION array directly asmixing and matching the session
functions and the direct access can really blow things up...

from the manual:
 With $_SESSION, there is no need to use the session_register(),
session_unregister(), session_is_registered() functions. 

> -----Original Message-----
> From: Sexton, David [mailto:dsexton at ubspw.com]
> Sent: Thursday, 08 May, 2003 1:08 PM
> To: NYPHP Talk
> Subject: [nycphp-talk] $_SESSION
> 
> 
> I'm hoping someone can help me with this... I am running PHP 4.1.2 on
> WINNT4.0 in CGI mode.
>  
> All I'm trying to do (as a test), is write data to a session 
> object using
> the $_SESSION superglobal, like so:
>  
> <?php
> session_register('test_var');
> $_SESSION['test_var'] = "Hello World";
> PRINT $_SESSION['test_var'];
> ?>
>  
> The variable 'test_var' registers, but the value 'Hello 
> World' does not get
> written. What's even more confusing is that the script prints 
> 'Hello World'
> to the screen. It seems like PHP is interpreting 
> $_SESSION['test_var'] as a
> custom built associative array, since it is printing the value but not
> storing it in the session file.
>  
> Some folks suggested it may be a compatibility issue between 
> $_SESSION and
> register_globals = On - So I turned them off and it still 
> doesn't work.
>  
> The session files are writable if I use the registered 
> globals, but that is
> both insecure and a pain because I have to pay attention to 
> scope within
> functions.
>  
> Anybody have any suggestions on what the problem could be?
>  
> Thanks.
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030508/d80d2cb1/attachment.html>


More information about the talk mailing list