Chris Luksha wrote: > I am new to CF and wondering if there is a way to have a login page that > would be accessed when a user comes to any page in the application, (Say > they bookmarked a page deeper than the root,) and the user would be sent to > the originally requested page after logging in. > > ie. > User goes to <http://www.webaddress.com/photos/addphoto.cfm> > ww.webaddress.com/photos/addphoto.cfm or showphots.cfm > User is sent to to <http://www.webaddress.com/photos> > ww.webaddress.com/photos/login.cfm > After logging in user is replaced to > <http://www.webaddress.com/photos/addphoto.cfm> > ww.webaddress.com/photos/addphoto.cfm or showphotos.cfm respectively.
I think this is the wrong approach. Why send him to a different page when you can just keep him on the same page and authenticate him there. Just use the authentication mechanisms build into HTTP instead of the redirect circus. When the user hits the page, check whether he is logged in. If not, send a HTTP statuscode that tells "Access denied, please authenticate". User types username and password and the browser repeats the original HTTP request but now with authentication headers. You log him in using these headers and that is all. Advantage is that the browser takes care of all the locations and requests, instead of having to code it explicitly. For a crude example see http://jochem.vandieten.net/coldfusion/customtags/login Jochem ______________________________________________________________________ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

