Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Asp Cookie

Guest
Aug 21, 2006 Aug 21, 2006
I am having and issue with an .asp page that was built in Dreamweaver that is used to log users in to the website it logs the users in just fine but when they click on a page that is restricted to just registered users, it logs them out and makes them sign back in, I am not sure how to fix this issue I have tired everything I can think of to correct this problem, the website is almost done the only thing holding it up this one issue. Any help would be great.
TOPICS
Server side applications
471
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 21, 2006 Aug 21, 2006
an url would help, the code that's making it perform this way woudl be
better.

don't forget to change your recordset names, etc.

hth,

jon

"the_mann245" <webforumsuser@macromedia.com> wrote in message
news:ecd59s$d1f$1@forums.macromedia.com...
>I am having and issue with an .asp page that was built in Dreamweaver that
>is
> used to log users in to the website it logs the users in just fine but
> when
> they click on a page that is restricted to just registered users, it logs
> them
> out and makes them sign back in, I am not sure how to fix this issue I
> have
> tired everything I can think of to correct this problem, the website is
> almost
> done the only thing holding it up this one issue. Any help would be
> great.
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 21, 2006 Aug 21, 2006
The url for the site is Turcich.info there is a login form on that page and the database is written in access 2000.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 21, 2006 Aug 21, 2006
If you are using the standard login behaviour it creates a session variable
called MM_UserName. It sounds like something is stopping this from being
set. An easy way to prove this is to create a new page and simply place the
following code on it

<%=session("MM_UserName")%>

Then after you have logged in, go the page and see if anything appears.


--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"the_mann245" <webforumsuser@macromedia.com> wrote in message
news:ecd59s$d1f$1@forums.macromedia.com...
>I am having and issue with an .asp page that was built in Dreamweaver that
>is
> used to log users in to the website it logs the users in just fine but
> when
> they click on a page that is restricted to just registered users, it logs
> them
> out and makes them sign back in, I am not sure how to fix this issue I
> have
> tired everything I can think of to correct this problem, the website is
> almost
> done the only thing holding it up this one issue. Any help would be
> great.
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 21, 2006 Aug 21, 2006
Ok paul does that work with Dreamweaver 8 cause that is what i am using
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 21, 2006 Aug 21, 2006
Yes

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"the_mann245" <webforumsuser@macromedia.com> wrote in message
news:ecdcf1$ldl$1@forums.macromedia.com...
> Ok paul does that work with Dreamweaver 8 cause that is what i am using


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 21, 2006 Aug 21, 2006
Yeah this line <%=session("MM_UserName")%> is not anywhere on the login page and I set the connection up using the standard way. I am not sure if it makes a difference that the Database was written in an Access 2000 format. so where would that line of code need to go and does it need to go on every page that is restricted. Sorry for all the questions this is the frist time i have connected a DB to a website.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 21, 2006 Aug 21, 2006
Here is the code for the login page right from DW 8

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/username_db.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("Username"))
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd

MM_fldUserAuthorization = "Approved"
MM_redirectLoginSuccess = "loggedin.asp"
MM_redirectLoginFailed = "fail_login.asp"

MM_loginSQL = "SELECT Username, Password"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM Info WHERE Username = ? AND Password = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_username_db_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 255, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("Password")) ' adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute

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
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" 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)
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="images/favicon.ico" >
<link rel="icon" href="images/animated_favicon1.gif" type="image/gif" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome to the Nevada Turcich Website</title>
<style type="text/css">
<!--
.style1 {font-size: 24pt}
.style3 {font-size: 14pt}
.style5 {font-size: 12pt}
-->
</style>
<link rel="shortcut icon" href="images/favicon.ico" >
<link rel="icon" href="images/animated_favicon1.gif" type="image/gif" >
</head>
<body>
<div align="center" class="style1">
<a href=" http://www.wunderground.com/US/NV/Carson_City.html?bannertypeclick=big2">
<img src=" http://banners.wunderground.com/weathersticker/big2_both_cond/language/www/US/NV/Carson_City.gif" border=0
alt="Click for Carson City, Nevada Forecast" height=60 width=468></a><br />
Welcome to the Nevada Turcich Website<br />
<span class="style3"><a href="index.asp">Home</a> | <a href="prop/index.asp">Property</a> | <a href="family/index.asp">Family</a> | <a href="media/index.asp">Media</a><a href="media.asp"></a></span> <br />
</div>
<div align="left">
<p align="center">This Site is Currently Under Construction so some features may not work.<br />
But keep checking back as updates to the site are made daily.</p>
</div>
<div align="center">
<script type="text/javascript" SRC="javascript/date.js"></SCRIPT>
<br />
<p><span class="style5">You must be a User to View this website!</span></p>
<p align="right"><a href="reg.asp">Click here</a> to register </p>
<table width="317" height="249" border="1" align="right">
<tr>
<td height="243" valign="top"><form id="login_index" name="login_index" method="POST" action="<%=MM_LoginAction%>">
<label for="label6">
<div align="left">
<p>If you have been approved please enter your information <br />
</p>
</div>
</label>
UserName:
<input type="text" name="Username" id="Username" />
<br />
<label for="label7">Password: </label>
<input name="Password" type="password" id="password" maxlength="8" />
<br />
<br />
<br />
<label for="label8">Submit</label>
<input type="submit" name="Submit2" value="Submit" id="label8" />
</form></td>
</tr>
</table>
<p>If you have an RSS Reader you can click here an get the latest news and Events.</p>
<p>If you dont have an RSS reader click here for a list of readers. </p>
<p align="center"> </p>
<p align="center">This website is Hosted By: </p>
<p align="center"><a href=" http://www.1and1.com/?k_id=11076485" target="_blank"><img src=" http://banner.1and1.com/xml/banner?size=3%26%number=2" width="120" height="60" alt="Banner" border="0"/></a></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Copyright 2006 David Star Enterprises </p>
<p>This Site was designed by David Star Enterprises<br />
An Idaho and Nevada Company </p>
</div>
</body>
</html>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 21, 2006 Aug 21, 2006
The code that I gave you does not appear anywhere on the log in page. It was
designed to be placed on a new page. Then after you have logged in, you
would call the page to see if anything appeared. If it did not then the
problem would be in the way that sessions are being set.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"the_mann245" <webforumsuser@macromedia.com> wrote in message
news:ecdekq$nrv$1@forums.macromedia.com...
> Yeah this line <%=session("MM_UserName")%> is not anywhere on the login
> page
> and I set the connection up using the standard way. I am not sure if it
> makes
> a difference that the Database was written in an Access 2000 format. so
> where
> would that line of code need to go and does it need to go on every page
> that is
> restricted. Sorry for all the questions this is the frist time i have
> connected a DB to a website.
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 21, 2006 Aug 21, 2006
right that page of code is how the page was built in DW 8 Ok so i will create a new page and put that code in.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 21, 2006 Aug 21, 2006
LATEST
Ok i got the pages to work but only if i set the restriction to just the username and password and not the level box. And this <%=session("MM_UserName")%> did not do anything really cause i took it out and the page still works with the username and the password set but once the level is set everything stops and that code doesnt even correct that problem. The person that page is being built for wants restirction on based on the database so they can approve who an see the website and who cant see it. oh u can also get a hold of me on yahoo at the_mann245 if that is easier.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines