Hi Guys,
This is my full code....
signup.asp
<form name=frmMemberLogin action=login.asp method=post>
<input type=hidden name=URL value="<%=varRedirectURL%>">
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor=#ffffff>
<tr>
<td width="45%" class="normalText"><div align="right">Email
Address </div></td>
<td width="55%" class="normalText"><input name="txtEmail" type="text" class="txt" id="txtEmail" size="30"></td>
</tr>
<tr>
<td width="45%" class="normalText"><div align="right">Password </div></td>
<td width="55%" class="normalText"><input name="txtPassword" type="password" class="txt" id="txtPassword" size="20"></td>
</tr>
<tr>
<td width="45%" class="normalText"><div align="right"></div></td>
<td width="55%" class="normalText"><input name="btnSubmit" type="submit" class="btn" id="btnSubmit2" value="Login"></td>
</tr>
</table>
</form>
login.asp
<!-- #include virtual="/library/member.asp" -->
<%
varEmail = Request.Form("txtEmail")
varPassword = Request.Form("txtPassword")
varRedirectURL = Request.Form("URL")
Set objLoginMember = New Member
If objLoginMember.memberLogin(varEmail, varPassword) Then
Session("memberID") = objLoginMember.memberID
If LTrim(RTrim(varRedirectURL)) = "" OR isNull(varRedirectURL) Then
Response.Redirect "/default.asp?mode=1"
Else
Response.Redirect varRedirectURL
End If
Else
If LTrim(RTrim(varRedirectURL)) = "" OR isNull(varRedirectURL) Then
Response.Redirect "signin.asp?mode=2"
Else
Response.Redirect "signin.asp?mode=2&URL=" & varRedirectURL
End If
End If
%>
signin.asp is where the form user needs to fill up email address and password.
login.asp page is where the authentication runs.
This function (objLoginMember.memberLogin(varEmail, varPassword) ) will return True or False. If true, it will assign member ID into session and redirect the user to the default.asp page.
varRedirectURL variable will hold the URL where user were redirected from. If authentication correct, it will be redirected back to that URL.
Anything wrong with the assignment of member ID into session???
I have included a virtual directory and there are sub folder in it... would it affect the session variables??
Tang
Quote:
Originally posted by Frettmaestro
I have never in my time as a professional webdeveloper (4 years) experienced that a session "forgets" anything and I have used it ALOT, so my guess is that this session of yours doesn't get set at all. If you post yur real code instead of pseudo-code it might be easier to debug...
...and for the record Bunce, sessions don't get sent to the browser. Sessions are stored on the server (and cookies are stored on the client) and once you reference either one of them in your ASP they are set right away.
|