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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

log out problem

Status
Not open for further replies.

omerdurdu

Programmer
Joined
Jul 21, 2001
Messages
72
Location
TR
Can someone help me
I have two frames, left one shows links, right one shows output. When I click login link in the left, a login page is coming up and I use username and password and login the page. When I click again login link in left, this time login page is not coming up, It is going to direct to the page. What can be wrong: here is the code:

Application.cfm
---------------
<CFSET DataSource = &quot;Ana&quot;>
<CFSET CompanyName = &quot;Anakara&quot;>

<!--- Name our app, and enable Session variables --->
<CFAPPLICATION
NAME=&quot;Anakara&quot;
SESSIONMANAGEMENT=&quot;Yes&quot;
setclientcookies=&quot;no&quot;
sessiontimeout=&quot;#CreateTimeSpan(0,0,0,0)#&quot;
applicationtimeout=&quot;#CreateTimeSpan(0,0,0,0)#&quot;>

<!--- If user is not logged in, force them to now --->
<CFIF NOT IsDefined(&quot;SESSION.Auth.IsLoggedIn&quot;)>
<CFINCLUDE TEMPLATE=&quot;LoginForm1.cfm&quot;>
<CFABORT>
</CFIF>
-----------------------------------------------
 
Seems you are setting a session variable for the login so the user will be logged in for the duration of their sessions. How does the user log out? To logout the user you should have a link will kill the session using structclear:

StructClear(session)

This works because the session scope is stored as a structure. Bear in mind that if the user does not logout then they will remain logged in and anyone who uses the browser will the session is still active can browse the secure section without having to login
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top