Forums

This topic is locked

Login Session Variable

Posted 22 Oct 2002 05:27:49
1
has voted
22 Oct 2002 05:27:49 Daryl Strickland posted:
Session Variables

I know this is simple but I just cannot get it. I need a session variable for DWMX in asp that will track users after they login. Here is the latest variation (Out of a hundred) I have tried.

1. On my login page, I have two text boxes. One for userID and one for password. I only want to use the UserID text box.

I created a session variable named “UserID” In the Dynamic Data Box the value shows the UserID link which looks correct.

2. Now this is where I am stuck. Do I put the source code on my “Go to” page which is named “Welcome.asp”? On the other hand, do I put the code on the login page?
Here is my code that I put just above my HTML tag on my “Welcome” page.

session("UserID" = Request.Form("Login" Login is the name of my login form.

Here is the SQL I put on my “welcome” page using the simple recordset box


SELECT CustomerID
FROM Wholesalers
WHERE CustomerID LIKE '%MMColParam%'

In the columns, I selected the CustomerID only. This is where I store my Users. In the Filter box I put “CustomerID” Next to it I put “Contains” Under filter I put “Session Variable” and next to it I put “UserID”

Finally I put the session variable in a table on my “Welcome” page but nothing shows when I publish.

Thank you for any help.

Daryl,

Plantsnet.com
<pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Replies

Replied 23 Oct 2002 16:21:23
23 Oct 2002 16:21:23 Some One replied:
MM Standart User Session Variable is "MM_Username"

Try this;
&lt;%=Session(MM_Username)%&gt;

Ferruh Mavituna : Freelance Web Designer & Developer;
Replied 25 Oct 2002 14:44:54
25 Oct 2002 14:44:54 Randy Huitema replied:
Hey Darly,

I ran in to the same problem. I found an article on the net, but can not find it now. Here is the jist.

Insert your login behaviour as usual, which will give you the code below. In the code you need to add this line;

Session("EDID" = MM_rsUser.Fields.Item("ADDRESSID".Value

This creates a session variable EDID ( values from ADDRESSID which matches your username & password) which you can request on your success page as the criteria for your recordset.

Randy





If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username" = MM_valUsername
Session("EDID" = MM_rsUser.Fields.Item("ADDRESSID".Value
If (MM_fldUserAuthorization &lt;&gt; "" Then
Session("MM_UserAuthorization" = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization" = ""
End If
if CStr(Request.QueryString("accessdenied") &lt;&gt; "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied"
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)<b></b>

Reply to this topic