Re: Page redirect



[Note: parts of this message were removed to make it a legal post.]

Hi,
The solution is simply save requested url in session and after user logged
in send it back to
the session url.

If you are using restful authentication, you may get the solution,
http://github.com/technoweenie/restful-authentication.

# Redirect to the URI stored by the most recent store_location call or
# to the passed default. Set an appropriately modified
# after_filter :store_location, :only => [:index, :new, :show, :edit]
# for any controller you want to be bounce-backable.


def redirect_back_or_default(default)
redirect_to(session[:return_to] || default)
session[:return_to] = nil
end


On Wed, Sep 30, 2009 at 2:43 PM, Sharanya Suresh <sharankruthi@xxxxxxxxx>wrote:

Hi,

In my application, if someone enters url which requires login, am
redirecting to login page if they have not logged in already, after
logging, i want to take the user to page from where he has been
redirected to login page. how it can be done?

example : questions/new -> redirected to login
after logging, redirect user to questions/new

How to do?

Thankx in advance
--
Posted via http://www.ruby-forum.com/.




--
--
Thanks and Regards
Saurabh Purnaye
+91-9922071155
skype: sorab_pune
yahoo & gtalk: saurabh.purnaye
msn: psaurabh@xxxxxxxx
--
please don't print this e-mail unless you really need to.

.



Relevant Pages

  • Re: Logged in - Session timeout
    ... You have that info in a session, and then simply send them to: ... take any querystring info with it that you may need.... ... Now the users times out and you redirect them to your login page, ...
    (microsoft.public.inetserver.asp.general)
  • Re: Remember me in Login control.
    ... session time, even if he drops his browser, you can move to SQL Server ... there is a "Remember me" check box in Login control is VS.NET ... It allows you to get in the page without logging it if user closes ... It works...however, in the authenticate event, what if session is used? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Need to know when user logs in again.
    ... Why not do it in the Login page before you redirect after a successful ... Neither Session start nor that global.asax event are appropriate for this ... > I have a forms based authentication. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Session object timout
    ... must go through a login page. ... Upon logging in I set some properties in a ... to a session object which I named "CurrentUserInfo". ... Since the app relies on retrieving only information for the company of which ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Session Management when launching "New" Window
    ... ASP.NET page creates a session object against our application ... session redirect to a different page rather than the login. ... redirect to a page with some javascript that checks if it's a child window ...
    (microsoft.public.dotnet.framework.aspnet)