Jump to content

[SOLVED] Maintaining a tab value?


unsider

Recommended Posts

Let's say you have 3 tabs:

 

1 | 2 | 3

 

When the page is loaded for first time it is defaulted to "1". The user, regardless of log-in status, sets the tab to "2".

 

I would like to maintain the tab value of "2" from visit to visit.

 

What would be the best method of doing this? I would think cookies, and it would make the most sense, but I have no idea.

 

If this wasn't clear please let me know.

 

Thanks.

Link to comment
Share on other sites

cookies would definitely be the way to go for something so simple.  if you only want it to stay for the duration of their browsing, you could use sessions like anything else, but clearly you want it to persist forever and ever and ever, amen.  so cookies are your solution.

 

another option would be to store it in the database by IP, but IP's are notoriously unreliable and intermittently get recycled by some ISPs (depending on their DHCP settings).

Link to comment
Share on other sites

cookies would definitely be the way to go for something so simple.  if you only want it to stay for the duration of their browsing, you could use sessions like anything else, but clearly you want it to persist forever and ever and ever, amen.  so cookies are your solution.

 

another option would be to store it in the database by IP, but IP's are notoriously unreliable and intermittently get recycled by some ISPs (depending on their DHCP settings).

 

Alright, great!

 

Thanks for confirming.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
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.