Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging out problem....

Status
Not open for further replies.

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=&quot;FindUser&quot; datasource=&quot;intervox&quot;>
Select * From User
where Login = '#Form.Login#' and
Password = '#Form.Password#'
</cfquery>

<cfif FindUser.RecordCount IS &quot;0&quot;>
<font face=&quot;Arial&quot;><h4>Login Incorrect!</h4>
Press Back button in your Browser and try again! <br>
or Click <A href=&quot;index.html&quot;><STRONG>here</STRONG></A><STRONG></font>
<cfelse>
<CFSET Expiretime=DateAdd(&quot;n&quot;, 20, Now())>
<cfcookie Name=&quot;Time&quot; value=&quot;#Expiretime#&quot;>
<CFCOOKIE NAME=&quot;Login&quot; VAlue='#Form.Login#'>
<CFINCLUDE TEMPLATE=&quot;mainpage.cfm&quot;>
<cfquery name=&quot;username&quot; datasource=&quot;intervox&quot;>
select * from user where login like '#cookie.login#'
</cfquery>

<cfquery name=&quot;login&quot; datasource=&quot;intervox&quot;>
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(&quot;Cookie.Login&quot;)>

<cfquery name=&quot;add&quot; datasource=&quot;intervox&quot;>

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=&quot;getid&quot; datasource=&quot;intervox&quot;>
select * from intervox where id=(select max(ID) from Intervox )

</cfquery>

<cfquery name=&quot;username&quot; datasource=&quot;intervox&quot;>
select * from user where login like '#cookie.login#'
</cfquery>

<cfquery name=&quot;logadd&quot; datasource=&quot;intervox&quot;>
Insert into logtable
(user,action,when)
values
('#username.firstname#','addition',#now()#)

</cfquery>
<cfinclude template=&quot;menu.cfm&quot;>
<cfoutput>
<cflocation url=&quot; </cfoutput>
<br>

<br>




<cfelse>
<h2><font face=&quot;Arial&quot;>Sorry! You already Logged out! Please click <a href=&quot;index.html&quot;>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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top