OK, in this case you may want to store the previous page path in the session
then before they hit the login page.

If the page is abritray you will need to keep a session variable of the last
page viewed, except for login page, this means on every page you will need
to set/re-set the session varibale.

A simpler option would be to have one set page for when a user logs out, and
when a user logs in, this would simplify the process a lot and you would not
have to keep a track of pages, just a thought.



2009/8/20 Enkhbilguun Erdenetsogt <[email protected]>

> Thank you for you email, Daniel Latter.
>
> As your advise, I created hidden form element that stores the page path,
> and it is working if the login is in the page the user was on.
>
> $returnUrl = new Zend_Form_Element_Hidden('returnUrl');
>
> $returnUrl->setValue(Zend_Controller_Front::getInstance()->getRequest()->getRequestUri());
>
> However, if a user is forwarded to the login page, above method won't work
> as I'm expecting. I don't know much about HTTP_Referrer, but I guess I would
> be the same as hidden form method.
> In that case, how can I store the page path?
>
> Please advise me.
>
> Thank you very much for your support.
>
>
> Daniel Latter wrote:
>
>> Hi,
>>
>> You will need to capture and store the page path the user was on. Then you
>> can use the redirector, see here:
>>
>>
>> http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.redirector
>>
>> Dan
>>
>> 2009/8/20 Enkhbilguun Erdenetsogt <[email protected] <mailto:
>> [email protected]>>
>>
>>    Hello,
>>
>>    I'm building a user login/logout functionality in my ZF project. I
>>    just want to forward a user, just logged in or out, to the page
>>    before the user logged in or out. Could you tell me which commands
>>    I should use?
>>
>>
>>    Thank you very much friends.
>>
>>
>>
>

Reply via email to