A simple app to secure coldfusion pages - Running into an issue with Session

Hello, I am testing out how to protect pages in coldfusion and have run into an issue when attempting to create a process by which users can log out.
Essentially, I have three pages:
Page A - The form that submits to Page B
Page B - That checks the form.username and form.password against a database (works fine)
Page C - Logout page (Which is where I am having an issue).
Page C throws a "variable Session is undefined" error
Here is the code on Page C:
<cfset StructClear(Session)>
<cflocation url="index.cfm">
Here is the code on Page B:
<cfif NOT IsDefined ("form.username")>
<cflocation url="index.cfm" addtoken="No">
</cfif>
<cfquery name="test" datasource="cfdb">
SELECT * FROM USERS
WHERE USERNAME = '#FORM.username#'
AND PASSWORD = '#FORM.password#'
</cfquery>
<!---<CFSET Session.LoggedIn = "1">
<CFSET Session.FirstName = "#test.FirstName#">--->
<CFIF test.RecordCount IS 0>
<cflocation url="index.cfm" addtoken="No">
<CFSET StructClear(Session)>
<cfelse>
<CFSET Session.LoggedIn = "1">
<!---<cflocation url="test.cfm" addtoken="No">--->
</cfif>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p><a href="logout.cfm">Log Out</a></p>
<p> </p>
<p> </p>
<p><br>
  This content is protected.
</p>
</body>
</html>
As you can see, nothing fancy
Now, I thought that the Session variable could be accessed by any page within a given browser instance, but I am obviously wrong.
What do I need to do for Page C (my logout page to be able to access the session variable).
Any guidance is greatly appreciated!

1.
“Variable Session is undefined” error comes up when you try to manipulate a session variable which does not exist, as at that point in time. To take care of possible empty session structures, it is good practice to check first if your session is defined.
So you will have something like:
<cfif isDefined("session")>
<cfset StructClear(Session) />
<cfelse>
<cflocation url="index.cfm">
</cfif>
2.
To enable you access your session variables from any page in your application, you need to enable session management in your Application.cfm or Application.cfc.
cfm   <cfapplication sessionmanagement="Yes" />
cfc        <cfcomponent>
<cfset THIS.SessionManagement = "Yes" />
</cfcomponent>
Reference…http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24 -7c48.html

Similar Messages

  • Has anyone run into an issue with their hotmail account being hacked on ios 6 ?

    Im noticing that I am getting strange MALIER DEAMON emailsadvising me that my email to whomever could not be sent.I have preiously run into this issue and it turned out my yahoo account had been hacked when I began getting those messages. Has this happened to anyone else?

    Try this:
    Go to System Preferences - Bluetooth. Delete the keyboard from the list of devices by pressing the "-" button. Take the batteries out of the keyboard and reinsert them. In Bluetooth Preferences press the '+" button to add the new device. If the keyboard begins to pair, click the word "pair" and type in the passcode. Press return. The keyboard is now paired.
    If the mouse is not pairing, try this: shut down the computer completely, unplug any USB mice, then turn off the power to the bluetooth mouse.  ONce the computer starts up again, wait for the pop-up looking for a mouse.  Turn on the power to the bluetooth mouse.  It should work normally now.

  • Is there an app for converting a Pages document into a Word document

    is there an app for converting a Pages document into a Word document?

    In pages, Use the menu Share - Export - to Word.
    Matt

  • I have 2 sons that were sharing one account and now I want to separate them, will I run into any issues ?

    I have twin sons and my wife sharing one itunes account and now from what a relative told me I should split them up since face time from my sons itouch is showing up on my wife's iphone ... so I started a new itunes account for all 3 of them, and now I want to sync each of their devices with their own accounts, before they had all the same music, etc... will I run into any issues when syncing each of their devices... meaning will I see a message like "this device is synced with another account and then it will say if I proceed it will erase what is on the device" ... ??  will I see this or will it just sync as normal
    Thanks

    You can't merge accounts or transfer iTunes purchases from one Apple ID to another: but there is no problem about using two IDs.
    Use your iCloud ID for iCloud for syncing email, contacts, calendars, bookmarks, and PhotoStream.
    Use your other Apple ID as before for iTunes, iTunes in the Cloud and iTunes Match.
    There's no conflict about doing this, and you won't even notice as Keychain will log you in with the correct ID in each case. It's also better security not to have your iTunes login also your email address, given the number of complaints about hacked iTunes accounts.

  • I've run into a problem with my trail version of Adobe Premier 13, and it appears to be a major one.

    I’ve run into a problem with my trail version of Adobe Premier 13, and it appears to be a major one. Here’s what happened.  Yesterday when I turned on the computer, I got a prompt asking if I wanted to link my Adobe Lightroom with Adobe Premier.  I “x’d” the prompt but then the computer went into a “do not turn off” mode.  45 minutes later the computer was still prompting me not to turn it off. Thinking that the computer was hung up I did turn it off.  Then I turned it back on, went to Adobe Lightroom to discover that all my work from the past three-to four years had disappeared. 
    At this point I am afraid to mess with Adobe Premier, so it’s still on my computer.  I used Windows 7, Photoshop CS3 and Lightroom 4.  Do you think if I uninstalled my trial version of Adobe Premier 13, my work on Lightroom would return?  Or is it lost?
    Thanks to any who offer suggestions. 
    Bert Gildart

    Bert Gildart
    I was unaware that you could establish any direct linkage between Lightroom and Premiere Elements. Are you sure that the association was to be for  Photoshop CS3 and Lightroom?
    Have you tried to do a System Restore to a point before you installed Premiere Elements 13 or before you OK'd whatever this Lightroom linkage was?
    Have you asked your question in the Adobe Lightroom Forum, asking about recovery of work lost from Lightroom? Have you found any traces of your lost Lightroom work in the Recycle Bin?
    ATR

  • When downloading the trial, has anyone run into download issues?

    when downloading the trial, has anyone run into download issues?

    I remembered we have weird permission issues at work. Somewhere between my Home Windows 8 machine(horrible permissions issues with network), my home mac, email and my work computer, some permission got out of whack. The workaround for this was copying the file to my desktop, back to the exact same spot on the network. This resolved all issues.

  • Bootcamp, running into multiple issues....

    As a little bit of backstory, I bought a MacBook (late 2009 edition with Snow Leopard) because I was having issues with my old Windows XP PC desktop, which was invaded with trojans and viruses. I had to delete everything, start up from scratch and wipe the disc clean. Not pleasant.
    In the summer of 2010 I was convinced to buy a Macbook because it didn't need to be checked quite as often as a PC computer. I was astounded by the speed in which it booted up since I never had a custom built PC that contained optimized performance. Mostly however I had only used the Macbook as a means of searching the web and to use it to complete college assignments.
    It wasn't until last year that I decided I wanted to get Windows onto my Mac, but being unemployed and with no job, it was simply not an option, because I needed to get bills done on time. Fast forward to this year, and after months of frantic job searching I finally landed a job. Now with a steady income coming in I felt it was time to get Windows onto my Mac.
    Sadly it's easier said than done. I wasn't even aware of Mountain Lion and Mavericks until later this year, but I realized that upgrading to those systems required more than a simple DVD disk.  Since then it's been a obstacle course, and while I've done a lot of research on bootcamp files for the various Mac versions, there is still lots I don't know about. Which leads me to this problem.
    Since my Macintosh HD drive only holds 250 GB, I felt it was needed to get rid of some used space. After deleting various games that were left untouched the last couple of years, I have 150 GB of free space. Problem is, I cannot partition. Why? Because some OS X files cannot be moved.
    So I bought a Windows 7 Home Premium 64-bit disk off of Amazon, and when I realized I needed a Snow Leopard installation disk, I bought that too. I now just spend between $140-150 in software, which isn't too bad I guess. Turns out that the Macintosh HD drive was corrupt, so I restarted the Macbook using the Mac OS X installation disc to access Disk Utility. After verifying and repairing disk (I got the confirmation from the green text), I assumed I can partition. Nope. Same issue pops up. So I realized I needed to get rid of free space, so I run Disk Utility off of the operation system and used the delete free space (zero) option. After a hour it's finished. Make another attempt at partitioning. Failed.
    Now I don't know what to do. The steps involved require an external drive and an internal drive, along with a program named Carbon Copy Cleaner (CCC). So what am I supposed to do? There are options to unmount and make new disc images on Disk Utility, do I just run that and go from there? I'm very confused at the moment.

    This would of been nice if I had known all of this before I even attempted to make a partition, so now I need an external hard drive to get past the problem of the Mac OS X files not moving. I thought I only needed a Mac installation disc and the Windows 7 install disc but it turns out I was wrong.
    As for external hard drives, Seagate Backup Plus (1 TB) looks pretty good, that's more than enough to make a backup. I spent the past few days doing a lot of research on bootcamp. Since the Mac installation disc is actually 10.6.3, I may still have to have the bootcamp drivers (versions 3.1-3.3) to install onto the Windows partition, along with Apple Software update so the features actually work with Windows.
    Very frustrating, costing me over $210 just to try to partition, if this doesn't work then I know it's a bad hard drive. Probably will have to take the Macbook in to an Apple store and have them look at it. The external hard drive itself will be good purely for backup. I have to wonder if all this is simply worth the trouble, considering I've toyed with emulators in the past, which tend to fail on occasion.
    Repaired disc, erased free space in disc utility, etc. So I guess I have to wait.

  • Auto adjustment of page orientation causes printing issues with documents that have a page width greater than its page height.

    Hi,
    Since an upgrade from Word 2003 to Word 2010, we are experiencing printing issues with certain
    documents that have a page width greater than its page height.
    In Word 2003, it was no problem to set the page width greater than the page height while setting the page orientation to "portrait".
    In Word 2010, this seems impossible: despite leaving the page orientation to "portrait", if one changes the page width/height as stated,
    Word 2010 automatically adjusts the orientation to "landscape". Resetting the orientation to "portrait" will flip the page's width/heigth settings.
    This behaviour causes printing problems: the page prints out 90° rotated.
    I do not believe this is a printer driver issue: I tried several different printer drivers, and all give the same (bad) result. Setting the printer driver's page orientation settings (before printing) makes no difference, as
    Word 2010 seems to force the page orientation settings.
    Inserting the documents 90° rotated is not an option, since it causes problems with the printing margins.
    This is very annoying, since we have to print official documents of a municipality (driver's licences).
    Is there a workaround for this issue?
    Regards,
    Laurent Grandgaignage
    Sysadmin Gemeentebestuur Stabroek, Belgium

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    From your description, we can follow these steps to test this issue
    Step 1: Repair Office 2010
    1.      
    Click
    Start, and then click Control Panel.
    2.      
    Click
    Programs and Features.
    3.      
    Click the
    Office 2010 program that you want to repair, and then click
    Change.
    4.      
    Click
    Repair, and then click Continue. You might need to restart your computer after the repair is complete.
    Step 2:
    Rename the global template (Normal.dotm)Follow the steps for the operating system that you are using:
    Windows Vista and Windows 7
    a)      
    Exit Word 2010
    b)      
    Click
    Start.
    c)       
    In the
    Start Search box, type the following text, and then press
    ENTER:
    1.      
    %userprofile%\appdata\roaming\microsoft\templates
    d)      
    Right-click
    Normal.dotm, and then click Rename.
    e)      
    Type
    Oldword.old, and then press ENTER.
    Microsoft Windows XP
    a)      
    Exit Word 2010
    b)      
    Click
    Start, and then click Run.
    c)       
    In the
    Open box, type the following text, and then press ENTER:
    %userprofile%\Application Data\Microsoft\Templates
    d)      
    Right-click
    Normal.dotm, and then click Rename.
    e)      
    Type
    Oldword.old, and then press ENTER.
    f)       
    Close Windows Explorer.
    How to troubleshoot print failures in Word 2010, Word 2007, and Word 2003
    http://support.microsoft.com/kb/826845
    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
    I can do for you, please feel free to let me know.
    Hope that helps.
    Sincerely
    William Zhou CHNPlease remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Pages from iPad - Export issues with pdf, word

    issues when exporting documents out of Pages from iPad using pdf, and getting... "Cannot extract the embedded font 'VZEENN+Georgia-Bold'. Some characters may not display or print correctly". I have 10.5.8 and Adobe latest version 9.4... I have also tried different and more universal fonts on Pages like Arial or Helvetica with no success... Really frustrating to have so critical bugs. Any work arounds from anyone? Thanks!

    Yes, you can send the file as an email attachment to yourself and open it on a computer and print.
    You can use DropBox to place the files on the computer to print
    These are easiest if the file is saved (exported) as a PDF file so it is portable.
    You can also use an AirPrint enabled printer and print directly from the iPad without going through the computer.  But buying another printer is much more expensive than the cost ($20) of Pages for the MBP.
    If you already have a wireless printer, you can try the website for the manufacturer and see if there is an upgrade for the printer to enable it for AirPrint.

  • Battlefield 1942 Anthology issues... anyone run into same issues???

    Alright peep's. It's that time when I look for a little insight.
    I've got a stackload of PC games I said I was going to knock out when I had time. The issue I'm having is regarding Battlefield 1942. I got the boxset with all the expansions a few months back. I installed it and it went through properly. I configure the game to run with everything turned on and maxxed out, it begins to load. The issue I have then is when I try and select a spawning point, the game just locks up where I need to do a hard reset. I've got the latest update preinstalled even tried bringing down the resolution. The game actually worked once and was playable @ 1024 x 768 for about 8 minutes, then the game locked up again. I tried factory defaults and got no where. I recall reading somewhere else that some older games have issues with SLi. I just can't find that article with games listed. Is anyone running BF 1942 or has it installed without any issues with an SLi rig??? Any insight will be appreciated. I'd like to play a former game of the year on my PC and knock it out amongst my "Games to finish" list.
    BTW, since I couldn't get that game to run I installed Half-Life 2. Sick friggin' game. Awesome. Knocked it out in four nights. I think I'll get the expansion when it comes out in May. I'm now playing Star Wars: Republic Commando. Not bad for a FPS but I've played better.
    LPB

    Two things:
    1- I understand that this is a HARDWARE based messageboard. All other software and games work A-O-K. This is an exception so it would point to some sort of possible HARDWARE conflict with older SOFTWARE now, huh???
    2- Thermaltake 680w with SLi connectors.
    Realistcally, I'm not trying to be a smart a$$. I brought it up here because I know CoD is a popular game that many have gone through it like water. I posted because I've seen others with driver issues, software and/or OS conflicts, uncertainities, etc., and I laid out some wisdom and advice. Think I'm lying? Try reading a few boards regarding the K8N Diamond Plus, Sound Blaster XFi, video card issues, RAM questions, heck even overclocking. I'm still leaving feedback on EVGA's messageboard and I don't even own their motherboard anymore.
    All in all, I'm looking for help and a solution just like everyone else. And if you don't think that me being adult enough to ask for help then please just don't post any bulletins or feedback since I guess you get things to run flawlessly and you need no help whatsoever.
    And to others who actually made a positive contribution, thank you genuinely.
    LPB

  • In FireFox 9, loading secure web pages running on non-standard ports works just fine. In FireFox 10, those same pages do not load and a "The connection was reset" message is displayed.

    How can this be fixed so functionality returns as per FF9 and below?
    This occurs on any secured website running on a non-standard port, with FF10.

    < X-Post from https://support.mozilla.org/en-US/questions/917315#answer-315144 >
    I don't think this is restricted to Firefox. I've noted this behaviour with IE9, Firefox 10.0.2, Opera Mobile (on my phone) and Chrome(latest version) with my Linksys E3000 router (I access it from https://<IP>) and my 3ware RAID card management suite, 3DM2 (I access it from https://localhost:888 ).
    Notably, the only thing amiss that I've been able to see in the certificates (I'm no expert) is that the one from Linksys has issue and expiry dates in 1969 and 1970 respectively. However, I don't think this is the cause since 3DM2 has proper looking issue dates and has the identical problem.
    Coincidentally, I noticed this happening after a fresh reinstall of Windows 7 x64 with virtually nothing installed on it (FF, Office 2007), so I don't think it's something wrong with the other software on the machine.

  • Pages 5.0 can't open iCloud documents.  Has anybody run into this issue?

    Here's the story:
    I upgraded to Pages 5.0 and can't open .pages documents saved in icloud.
    It does not seem to be a file incompatibility.  I am creating files in Pages for Mac, saving them to iCloud.  They are immediately unable to re-open. 
    I only get a message saying:  The file “{file name}.pages” couldn’t be opened.
    Documents can be created without issue.  If they are saved to my local drive, I can open them again.
    Obviously, this makes it very difficult to use Pages with any other devices because document syncing is impossible.
    Details on my system:
    Mid-2010 13" Macbook pro
    2.4 Ghz core 2 duo
    8 GB ram
    OS X 10.9

    I was also experiencing same issues without being to open Older Pages Docs from iCloud in Pages 5.  I followed suneson Recommendation and process to the T...    Works perfectly. 
    Important to note you do have to do the second part in order for it to work completely.  I tested just the first half and still had issues.  Once Disabling and Re-enabling Documents and Clearing Cache - works perfectly now.  Thanks Suneson!
    Suneson process:
    Move all of your iCloud documents to a local folder (offline).
    Go to the iCloud preference pane i System Preferences.
    Click Manage... and delete all Pages data.
    The Next Step is required:
    Go back to iCloud preferences and uncheck "Documents & Data".
    Check it again.
    Delete ~/Library/Caches/--anything related to Pages or iWork--

  • TS1702 how can you update your apps on the itune page like you use to with the old itunes

    How can I update my apps on the new itunes?  On the previuos itunes i was able to update them won the computer the sync my phone - i can not locate the update notifacation area on this new itunes program

    With iTunes 11 you can enable the left-hand sidebar via option-command-S on a Mac, control-S on a PC. You should then be able to sleect the Apps section of your library on that left-hand sidebar, click the 'Check For Updates' button at the bottom of it and download any available updates. Then connect your phone and select it on the sidebar, select its Apps tab on the right-hand side of iTunes, and click the Sync button at the bottom of it - that should copy any app updates over to it

  • I am trying to use automator to make a simple app that when I open it, it comes up with a dialog box that asks for a link that you want to download. and it will download it for you using the curl -O shell script in Terminal. How would I do it?

    I want this so I can just download anything I want by just having the link and I have made a few things with shell scripts in automator before, just never anything where i need to input a value into the shell script.

    Easy:

  • Thanks for the upgrade to Firefox 4! Unfortunately, you don't say anywhere that it's not compatible with OSX 10.4. Might want to fix that so that other users don't run into this issue.

    After the latest upgrade to 3.whatever, Firefox asked if I'd like to upgrade to 4.0. I said yes, assuming (since Firefox has always been compatible before) that it'd install and work. It didn't. Why? Because Firefox is no longer supporting OSX 10.4, apparently. This should probably be noted SOMEWHERE so that trusting people like me don't screw up our existing Firefox.

    I looked for a link to the system requirements page before I downloaded to my PowerPC Mac, but I couldn't see it anywhere.
    However, I saw that Mozilla was bragging about supporting Windows XP whereas the new IE 9 did not. One would assume that if Mozilla was bragging about supporting that old Windows platform, they would also support a Mac platform of the same vintage.
    I did not assume wisely. I am very disappointed in the Mozilla team.
    For the record, I am running the latest version update of Leopard (10.5.?) on my PowerBook G4.

Maybe you are looking for