object in session & security

From: Date: Sun, 12 Jan 2003 23:47:33 +0000
Subject: object in session & security
Groups: php.general 
Request: Send a blank email to php-general+get-131373@lists.php.net to get a copy of this message
Hello, Im building a object oriented webapplication with PHP. I know PHP doesnt fully support OOP. I made a class called Database. This class contains several variables. One of these vars is the username and the password for the database. When i create a Database object I want to register it in the applications session, so it available through the whole app. Is this secure? is it possible to view this variable from the outside? To make it more secure i tried 'crypt()'. But this doesnt work in this way: class Database{ var $server="db.provider.com"; var $username="myusername"; var $password=crypt("8d3j22d"); var $database="webshop"; } it results in: Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'

« previous php.general (#131373) next »