RE:[PHP] sessions...how to use not clear?

From: Date: Tue, 23 Mar 2004 00:24:33 +0000
Subject: RE:[PHP] sessions...how to use not clear?
Groups: php.general 
Request: Send a blank email to php-general+get-181195@lists.php.net to get a copy of this message
you've already got that unique identifier. it's the username. the username will stay unique visit to visit, therefore you don't need to go against the design of the session id. the session id is not meant to keep uniqueness across multiple visits, only the current visit. are we/me misunderstanding you? yes the username is a thing different from anybody elses login but how will you collect preferences and the like in variables and dump them into a sql table without using a session to define them from everybody elses?? figure this: 1. if you just used a login page and sql table to verify the existance of a username/pwd and once "logged in" you had this code: <?php $color="green"; $show_time="0"; /*dont show the time on the page*/ now somebody else logges in: $color="yellow"; $show_time="1"; (both users are logged in at the same time)?? theory is the variables will conflict with each other... 2. using sessions: <?php session_name($user); session_start(); $_SESSION[color]="green"; $_SESSION[show_time]="0"; now they cant get messed up because: <?php session_name($user); /*user2 now logged in*/ .... will be totally different from user1.

« previous php.general (#181195) next »