# URL tracking

**URL:** <https://www.ruby-forum.com/t/url-tracking/138017>\
**Category:** Rails\
**Created:** [May 19, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/url-tracking/138017 "2008-05-19T14:59:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ripan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/df705f/32.png) [@ripan](https://www.ruby-forum.com/u/ripan)\
**Post date:** [May 19, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/url-tracking/138017/1 "2008-05-19T14:59:49Z")

</div>

Hi guys…

I want to keep track all urls of my rails application.

Suppose i m not logged in… i am clicking the links…after  
logging in i should come to that page which i viewed last time (in  
not logged in mode).  
can anyone tel me the logic…or how to keep track of the url of the  
website.

ripan

---

<div class="post-metadata">

**Author:** ![ripan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/df705f/32.png) [@ripan](https://www.ruby-forum.com/u/ripan)\
**Post date:** [May 20, 2008, 6:17am UTC](https://www.ruby-forum.com/t/url-tracking/138017/2 "2008-05-20T06:17:58Z")

</div>

There’s a method called stored\_location in authenticated\_system that can  
help with this. To use it call it in a before\_filter in your controller:

before\_filter :store\_location, :only =\> [:show]

and then when you want to redirect back to that action,

redirect\_back\_or\_default root\_path

On Mon, May 19, 2008 at 10:29 PM, ripan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ripan
> 
> >

–  
Appreciated my help?  
Recommend me on Working With Rails  
[http://workingwithrails.com/person/11030-ryan-bigg](http://workingwithrails.com/person/11030-ryan-bigg)
