How to store session/cookie in Drupal 6 on the computer of the visitor
drupal, drupal-6, drupal-views
Solution
Of course it can be done, but it is not the normal Drupal way of doing it. What you typically do is store the information either in the session (use `sess_write`/`sess_read`) or, if the user is logged-in, in the user account info.
Keeping information in the cookie means it can be tampered with on the client side, and you'll need to make your code extra foolproof, as with any user-originated data.
If you keep it in the session, it will be kept for as long as the session lives, but disappear thereafter. For anonymous users, there is really no better way. OTOH, for logged-in users, storing the info in `$user->data` means they will be available as long as you don't remove them, because they'll be stored in the `users` tables.
Also remember that drupal session cookies are regenerated when switching from anonymous to logged-in, but keep the session content, so you can put data in the anonymous session and still have it when the user logs in, and then store them in his account data. Look at `includes/session.inc` for details about how this works.
Problem
I have created a search for a client website using Finder module in conjunction with Views module. The problem is that my client wants that each time a user selects and searches for the businesses in a certain area, then the same should be stored as session or cookie on the computer of the visitor. This would ensure that a repeat visitor sees the same search which he had done earlier. Please check the site: http://naplesres.designbracket.com/ Moreover, I also want to know if based on the search earlier can i configure the Views in a manner that on only business of his local area are passed in the rest of the views used on the website i.e. on the Auto, Beauty etc. pages. Any help in form of links to documents, pointers as to how to go about it would be deeply appreciated. Thanks