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

Deleting Session Variables on Logout 2

Status
Not open for further replies.

Kush

Programmer
Sep 20, 2000
24
0
0
US
I am trying to kill all session variables when the user logs out. On Logout, I am taking the user back to the Login Screen and I want to prevent him from going back into the application by clicking on the Back button of the browser.
I have the following code in my Logout.cfm, which is giving me an error:

<CFSET d = StructDelete &quot;#SESSION.Username#&quot;, &quot;True&quot;>
<CFLOCATION url=&quot;Login.cfm&quot;>

I am trying to use the StructDelete function to kill my session variable, although I am not using any structures. This is giving me an error and is also not preventing the user from going back into the application.

Can someone please tell me what could be wrong and how can I kill my session variable?

Thanks a lot.
 
Try this one
<CFSET d = StructDelete(session, &quot;Username&quot;, &quot;True&quot;)>
<CFLOCATION url=&quot;Login.cfm&quot;>
 
Hi Kush

This is how to Kill Session Variables, it wont however disable the back button. There are some suggestions for ways to work around this on the Javascript forum. Search for Disable Back button.


<CFLOCK timeout=&quot;1&quot;
name=&quot;#Session.SessionID#&quot;
Type=&quot;Exclusive&quot;>
<CFSET StructClear(Session)>
</CFLOCK>


Have fun. ;)
 
Excuse me Ram123,
I didn't see you there.

I guess we submitted at the same time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top