saseow
Posts: 744
|
| Posted: 02/16/2005, 9:53 AM |
|
In my login page, I want to store the user name as a session variable. I use the following code:
//Login_DoLogin_OnClick @7-096B22C1
function Login_DoLogin_OnClick()
{
$Login_DoLogin_OnClick = true;
//(TCR) Added 16 Feb 2005 to store user's name **************************************************************************
if ($Login_DoLogin_OnClick == true) {
$db = new clsDBessa();
CCSetSession("User_Name", CCDLookUp("name","users","user_id=".$db->ToSQL(CCGetUserID(),ccsInteger), $db) );
$db->close();
}
//*******************************************************************************************************************
//End Login_DoLogin_OnClick
In another page I display the user name. The problem is that the first time I log is as name1, I get nothing. I log out and back in as name2. It now displays name 1. Continually logging out and then as different users I keep getting the previous user's name. The code I use to display the user name is:
//(TCR)15 Feb 2005
// Check if records for this participant have already been created.
$userid = CCGetSession("UserID","");
$user_name = CCGetSession("User_Name","");
//echo $userid;
//echo $user_name;
// -------------------------
Is this s known bug in CCS or wha? Any guidence would be so good.
Thanks, Trevor
?
|
 |
 |
saseow
Posts: 744
|
| Posted: 02/16/2005, 8:26 PM |
|
I have got no answer from this. Can anyone even tell me if they have experienced the same hassle?
Thanks,
Trevor
|
 |
 |
peterr
Posts: 5971
|
| Posted: 02/16/2005, 8:39 PM |
|
Looks you added your code in a wrong place, before the user session is created. You would need to move your code to after the login is verified and UserID session is created.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
saseow
Posts: 744
|
| Posted: 02/17/2005, 5:37 PM |
|
I have sorted it all out now.
Thanks for the help Peter!
Trevor
|
 |
 |
|