EasyCFM.COM ColdFusion Forums / Coding Help! / Log In Problem

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Log In Problem

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

MikeBam
06-29-2004 @ 4:51 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 237
Joined: Jul 2003

Basically, I am making a simple form for verification into a section of a site without a database.

Below are simplified pages that explain my error:

--Application.cfm--

<cfparam name="session.allowin" default="false">


--login_page.cfm--

<form name="login" action="login_process.cfm" method="post">
<b>Keyword</b><br>
<input type="text" name="keyword"><br>
<input type="submit" value="submit">
</form>

--login_process.cfm--

<cfif form.keyword EQ "secretword">
<cfset session.allowin = "true">
    <script>
         alert("Keyword is correct.");
         self.location="/test/loggedin.cfm";
    </script>
<cfelse>
    <!--- this user did not log in correctly, alert and redirect to the login page --->
    <script>
        alert("Keyword Incorrect");
        self.location="Javascript:history.go(-1)";
    </script>
</cfif>



--loggedin.cfm--

<cfoutput>#session.allowin#</cfoutput>



On the loggedin.cfm page, when the keyword is correctly entered as "secretword," the session.allowin value comes up as "false."

I broke down my script problems and found that this is the error.

I can't understand why the login page isn't setting session.allowin to true.

It's probably something so simple I'm going to feel even more like an idiot than I already do.

Thanks a lot,

Mike

This message was edited by MikeBam on 6-29-04 @ 4:53 PM

jov17
06-30-2004 @ 11:29 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 76
Joined: Dec 2003

Hello,

I'm only an intermediate Coldfusion Programmer, but from what I can tell, your code looks good.

So in the input field, you're entering the word : "secretword" right?  If so, are you getting the alert?

Are there any errors that come up, if so, post them?  





-----------------------------

James Vasquez

http://www.bookstorebandits.com

jov17
06-30-2004 @ 11:29 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 76
Joined: Dec 2003

Hello,

I'm only an intermediate Coldfusion Programmer, but from what I can tell, your code looks good.

So in the input field, you're entering the word : "secretword" right?  If so, are you getting the alert?

Are there any errors that come up, if so, post them?  





-----------------------------

James Vasquez

http://www.bookstorebandits.com

GrowlyBear
06-30-2004 @ 1:12 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1314
Joined: May 2004

I have to ask this. You HAVE turned on session management in your application.cfm right?

~~~~My Foot..er~~~~~
Of all the things I did not know, I did not know that the most!

MikeBam
06-30-2004 @ 3:14 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 237
Joined: Jul 2003

Wow, I feel so stupid.

When I went to simplify the problem I deleted the session variables.

I have yet to figure out what that initial problem is, but I'm just going to rebuild the application and hopefully fix it.

Thanks Smile


Website Designed and Developed by Pablo Varando.