Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFCATCH/CFTRY-CFERROR

Participant ,
Dec 30, 2007 Dec 30, 2007
I am getting this error message when my users attempt to return to my site with an expired SESSION variable.

Element FNAME is undefined in SESSION

I could possibly fix the error but it would be difficult.........

Since I know its going to occur ...

How would I use CFCATCH/CFTRY-CFERROR to catch this error and redirect these users to the login screen?

PAT
405
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 31, 2007 Dec 31, 2007
LATEST
It's not difficult at all. You can check to see if a session var exists like so:

cfif structKeyExists(session, "fname")

What I would consider is using onRequestStart to check for one session var that you know exists, like fname, when the user is logged in, and if it doesn't exist, you push them to the login page.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources