Jump to content

Storing the referrer in session... problems with tabs


Recommended Posts

Hello All


I am currently working on an ERP project based on the MVC methodology, when a user navigates the site we store the referrer in session.


The problem we have is that using multiple tabs upsets our session stack of referrers, it would be good to store this stack as an associative array so we have a stack for each tab, as at the moment if you open a new tab, the original tab redirects to the wrong place.


The problem I have is that I need a unique identifier for that array, now it would be too easy to think that a tab_id would exist, but it doesn't appear so.




So does anybody know if it's possible to get the tab index, even if it's exclusively using FireFox (we will provide a fall-back for IE etc *pukes*)

Link to comment
Share on other sites

Yes I can.


Some of the important information will be posted in bold :)


A little background, this is an ERP solution so internal only, no more than 20 users.


When a user has entered information into a form and clicks save it fires the save function of the relevant controller, if the save is successful we need to return the user back to the last appropriate action, so in short the referrer is used to redirect the user back to the appropriate screen. Look at this demonstration of the order links are clicked:


View All Records  -->  Edit Record #2  --> Save Record #2


Now when we hit save on 'Edit Record #2' we don't want to go back to the 'Edit Record #2' screen, we want to back to the screen before that, in this case 'View All Records', and that is why we store a referrer stack in the session. The problem we have is the referrer stack was built before tabs exists so pukes up when we starts using multiple tabs.


Now consider this, we are viewing a list of records, clicking on one will present it's edit screen. So imaging we open two different records in separate tabs, e.g. 'Edit Record #3' and 'Edit Record #4'. Now when we open the 'Edit Record #3' the referrer is correctly set as the 'View All Records' screen,  but when we open 'Edit Record #4' it sets the referrer as the second edit screen.


The problem occurs when you save tab one 'Edit Record #3', it checks the last referrer and redirects back to the 'Edit Record #4' screen... but we need to send it back it's parent, and not the parent of any other tab.


Now to solve the problem we are having I want to change our referrer stack to an array, where the array is based on the browser tabs, that way we can track the referrers independently and the problem would solve itself.




I hope this helps :D




Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.