Guest_imported
New member
- Jan 1, 1970
- 0
Hi Guys:
I have coded a website for adding deleting modifying and searching my personal contacts.
Now i have also created a login page which uses the cfcookie command which verifys on every page whether the cookie is defined or not.
Now here is the problem. I uploaded the the cf files and run the program on net.Whenever i try to add a new contact it throws me out (means somehow cookie is expired or some problem), but the amazing thing is that the same program is running fine on my pws. One more thing i want to tell is that once i am thrown out and second time i login and try to add it does well on the net.
i am unable to crack the puzzle... if anyone can crack it it would be great.
below are the codes.
------------------------------------------------------
(this page checks the user login and then creates cookie if login is correct)
<html>
<head>
<title>User Login Check</title>
</head>
<cfquery name="FindUser" datasource="intervox">
Select * From User
where Login = '#Form.Login#' and
Password = '#Form.Password#'
</cfquery>
<cfif FindUser.RecordCount IS "0">
<font face="Arial"><h4>Login Incorrect!</h4>
Press Back button in your Browser and try again! <br>
or Click <A href="index.html"><STRONG>here</STRONG></A><STRONG></font>
<cfelse>
<CFSET Expiretime=DateAdd("n", 20, Now())>
<cfcookie Name="Time" value="#Expiretime#">
<CFCOOKIE NAME="Login" VAlue='#Form.Login#'>
<CFINCLUDE TEMPLATE="mainpage.cfm">
<cfquery name="username" datasource="intervox">
select * from user where login like '#cookie.login#'
</cfquery>
<cfquery name="login" datasource="intervox">
Insert into logtable
(user,action,when)
values
('#username.firstname#','Logged in',#now()#)
</cfquery>
</cfif>
</body>
</html>
------------------------------------------------------------
this code actually adds the data received in the form.
<cfif Isdefined("Cookie.Login"
>
<cfquery name="add" datasource="intervox">
INSERT INTO intervox (contact,Company,Address1,Address2,City,State,Zip,Country,Phone,Fax,phone_ext,fax_ext,website,Email,user2,create_date,edit_date,title,mobile_phone)
VALUES ('#contact#','#Company#','#Address1#','#Address2#','#City#','#State#','#Zip#','#Country#','#Phone#','#Fax#','#phone_ext#','#fax_ext#','#website#','#Email#','#group#',#now()#,#now()#,'#title#','#cell_phone#')
</cfquery>
<br>
<cfquery name="getid" datasource="intervox">
select * from intervox where id=(select max(ID) from Intervox )
</cfquery>
<cfquery name="username" datasource="intervox">
select * from user where login like '#cookie.login#'
</cfquery>
<cfquery name="logadd" datasource="intervox">
Insert into logtable
(user,action,when)
values
('#username.firstname#','addition',#now()#)
</cfquery>
<cfinclude template="menu.cfm">
<cfoutput>
<cflocation url=" </cfoutput>
<br>
<br>
<cfelse>
<h2><font face="Arial">Sorry! You already Logged out! Please click <a href="index.html">here</a> to login!</font></h2>
</cfif>
----------------------------------------------------------
if u neeed more clarification i can give, but i think there is some small problem.
thanx
gg
I have coded a website for adding deleting modifying and searching my personal contacts.
Now i have also created a login page which uses the cfcookie command which verifys on every page whether the cookie is defined or not.
Now here is the problem. I uploaded the the cf files and run the program on net.Whenever i try to add a new contact it throws me out (means somehow cookie is expired or some problem), but the amazing thing is that the same program is running fine on my pws. One more thing i want to tell is that once i am thrown out and second time i login and try to add it does well on the net.
i am unable to crack the puzzle... if anyone can crack it it would be great.
below are the codes.
------------------------------------------------------
(this page checks the user login and then creates cookie if login is correct)
<html>
<head>
<title>User Login Check</title>
</head>
<cfquery name="FindUser" datasource="intervox">
Select * From User
where Login = '#Form.Login#' and
Password = '#Form.Password#'
</cfquery>
<cfif FindUser.RecordCount IS "0">
<font face="Arial"><h4>Login Incorrect!</h4>
Press Back button in your Browser and try again! <br>
or Click <A href="index.html"><STRONG>here</STRONG></A><STRONG></font>
<cfelse>
<CFSET Expiretime=DateAdd("n", 20, Now())>
<cfcookie Name="Time" value="#Expiretime#">
<CFCOOKIE NAME="Login" VAlue='#Form.Login#'>
<CFINCLUDE TEMPLATE="mainpage.cfm">
<cfquery name="username" datasource="intervox">
select * from user where login like '#cookie.login#'
</cfquery>
<cfquery name="login" datasource="intervox">
Insert into logtable
(user,action,when)
values
('#username.firstname#','Logged in',#now()#)
</cfquery>
</cfif>
</body>
</html>
------------------------------------------------------------
this code actually adds the data received in the form.
<cfif Isdefined("Cookie.Login"
<cfquery name="add" datasource="intervox">
INSERT INTO intervox (contact,Company,Address1,Address2,City,State,Zip,Country,Phone,Fax,phone_ext,fax_ext,website,Email,user2,create_date,edit_date,title,mobile_phone)
VALUES ('#contact#','#Company#','#Address1#','#Address2#','#City#','#State#','#Zip#','#Country#','#Phone#','#Fax#','#phone_ext#','#fax_ext#','#website#','#Email#','#group#',#now()#,#now()#,'#title#','#cell_phone#')
</cfquery>
<br>
<cfquery name="getid" datasource="intervox">
select * from intervox where id=(select max(ID) from Intervox )
</cfquery>
<cfquery name="username" datasource="intervox">
select * from user where login like '#cookie.login#'
</cfquery>
<cfquery name="logadd" datasource="intervox">
Insert into logtable
(user,action,when)
values
('#username.firstname#','addition',#now()#)
</cfquery>
<cfinclude template="menu.cfm">
<cfoutput>
<cflocation url=" </cfoutput>
<br>
<br>
<cfelse>
<h2><font face="Arial">Sorry! You already Logged out! Please click <a href="index.html">here</a> to login!</font></h2>
</cfif>
----------------------------------------------------------
if u neeed more clarification i can give, but i think there is some small problem.
thanx
gg