unsider Posted August 23, 2008 Share Posted August 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/120959-solved-maintaining-a-tab-value/ Share on other sites More sharing options...
akitchin Posted August 23, 2008 Share Posted August 23, 2008 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). Quote Link to comment https://forums.phpfreaks.com/topic/120959-solved-maintaining-a-tab-value/#findComment-623589 Share on other sites More sharing options...
unsider Posted August 23, 2008 Author Share Posted August 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/120959-solved-maintaining-a-tab-value/#findComment-623591 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.