Example of this approach: 1. User visit index page and click on some "page1" link. You receive request for that "page1" - you know service_id (for example it is 5) and referer points to "index", so you save initial "page1" => $service_id to session. 2. On that page user follow next link "page2". You receive request for "page2" - referer points to "page1" and you search for this key in session, find there service_id (= 5), remove this record from session and save next one - "page2" => $service_id 3. And so on... 4. User open new index page in other browser window and click on "page10" link. Same situation as in #1, but you save "page10" => $new_service_id (for example, 125) to session and receive new chain to track.
User session in this case contain as much records "url" => service_id as much times he started from index. On each page reload by user you re-write corresponding record in session. We use this to give user "prev/next" navigation through search results without changing target pages URLs. On May 13, 6:20 pm, byqsri <[email protected]> wrote: > Sorry but in this way I must keep in session all pages the user load > with relative service_id? > > On 13 Mag, 05:34, "Dr. Loboto" <[email protected]> wrote: > > > You should save service_id in session as associative array: > > current_url => service_id. When your controller/action is requested, > > search service_id in session by $this->referer() key. You also should > > be always aware that referrer or session will be empty and be able to > > act normally in this case too. > > > On May 12, 10:39 pm, byqsri <[email protected]> wrote: > > > > On 12 Mag, 17:02, brian <[email protected]> wrote: > > > > > On Tue, May 12, 2009 at 4:33 AM, byqsri <[email protected]> > > > > wrote: > > > > > > Ok > > > > > But how can I know which service is active in a particular moment? > > > > > You could make the service_ids the array keys with a value of false, > > > > except the active one. > > > > I can't to do this because I can have some controller/action that is > > > requested in many services. > > > I must keep an information of active service in the session --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
