Re: [phplib] Logging out From: Kirk Ismay (captain <email protected>)
Date: 07/20/00

Kartic Krishnamurthy wrote:
>
> Hi List,
>
> This is a question on logging out a user.
>
> I have a link on my page to logout.php3. Upon clicking on the link, the user gets logged out. Then if the user reloads the page,
> it takes him to the login screen (loginform.ihtml) but here is where my problem. After logging in using a valid user/pass, the user
> gets logged off again (as the page reloaded was logout.php3).
>
> I do not want that to happen. Instead, if the user reloads the logout.php3 (in which state he is not yet authorized), he should get
> the login page but then be taken to the main page of my application.
>
> I also tried another route, which did not work either. After doing a $auth->logout(), I used $auth->login_if(1). This way, it
> showed the login box, but would let me login (kept telling that the user/pass is invalid!).
>
> Any suggestions?
>
> Thanks
> --Kartic
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>

What you need is a login url or menu. The loginform is displayed instead
of the current page, so if they reload the page, they login and get
redirected straight back to the logout page again.

Simply print a link to another page, like the home page. Don't use
$sess->purl() unless you *want* them to keep the same session.

-- 
Sincerely, Kirk Ismay
________________________________________________________________________
The Net Idea Telecommunications Inc	       Support: tech <email protected>
101-625 Front Street,			       Sales:  sales <email protected>
Nelson BC, V1L 4B6
Phone: 352-3512 Fax: 352-9780		 Open Monday to Friday 9:30-5:30
Toll Free: 1-888-246-4222		    10:00 - 4:00 on Saturdays
________________________________________________________________________

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>