Ok But you suppose that user (with page1 and page2 opened) clicks another link on page1 that opens page3 how can I to know that page3 is relative to the service of page1 (in session I have "page2" => $service_id and not "page1" => $service_id )
On 14 Mag, 05:02, "Dr. Loboto" <drlob...@gmail.com> wrote: > 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 <marco.rizze...@gmail.com> 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" <drlob...@gmail.com> 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 <marco.rizze...@gmail.com> wrote: > > > > > On 12 Mag, 17:02, brian <bally.z...@gmail.com> wrote: > > > > > > On Tue, May 12, 2009 at 4:33 AM, byqsri <marco.rizze...@gmail.com> > > > > > 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---