Forums

ASP

This topic is locked

Session Variable help...

Posted 27 Jun 2001 21:43:53
1
has voted
27 Jun 2001 21:43:53 Mary Aguilar posted:
Hello.
I created a login page successfuly, but can't seem to display the User's
name once he's logged in. I inserted the dynamic text to display the user's
name, but the only name that displays is the first name on the database, not
the one corresponding to the user name that logged in. This is the case no
matter which user name i use to log in.

I'm not too familiar with using cookies or session variables and can't seem
to find any 'how to' information regarding my little problem.

Any suggestions?

-Mary

Replies

Replied 27 Jun 2001 22:43:33
27 Jun 2001 22:43:33 Alexandra Bayo replied:
Ultradev creates a session variable called MM_Username when you use the server behavior to authenticate your user and password. Request this session variable to create a recordset with the info on your user and then select the name field and drag it to wherever you want it. Hope it helps.

Alexandra D. Bayo
Replied 27 Jun 2001 23:28:35
27 Jun 2001 23:28:35 Mary Aguilar replied:
Hi Alexandra. Thanks for replying. I tried this but it still isn't working. It's weird.

I had already tried what you suggested with no possitive results. I'm not sure if I'm doing this right. I set a session variable (MM_UserName) on the login page and I set a request session variable with the same name on the restricted page. I've tried doing this requesting the variable on the restricted page only, but either way it won't work

-Mary

Replied 28 Jun 2001 04:25:36
28 Jun 2001 04:25:36 Alexandra Bayo replied:
declare the session variable on your login page so its available throughout the site
then on the page where your user will be directed at logon create a recordset ', maybe this example can help?

SELECT Username, Employee_ID, Password, Access_Level, Email, FirstName, LastName, Client_ID
FROM tbl_Users
WHERE Username = 'MMColParam'

MMColParam is a variable set by Ultradev, or u can call it whatever you like, use a default value of 1 and runtime value of Session("MM_Username"in the variables list.
To be able to do this you should be in the advanced, not the simple view of the Recordset creation window.
Alternatively, there is a behavior in Macromedia Extensions downloads that allows you to set the value of a cookie, or a session variable, to the contents of a text box when submitted. You may want to look into this. Hope it helps.

Alex
Replied 17 Jun 2002 17:45:22
17 Jun 2002 17:45:22 Wil Turrin replied:
Hi,

I've run into this problem too. If you check the macromedia site, they've got a fix. It has to do with the fact that the page access the database three times (see tutorial for details) and the values aren't forwarded again.

At any rate, check out: www.macromedia.com/support/ultradev/ts/documents/passingformdata.htm

CU WiL

Reply to this topic