Can you explain why you want to do this? For what circumstance do they need a persistent unique value?
The only thing I can think of is to store data on a persistent medium - ie database or file. And in both of these cases you can easily generate a unique one (file / row), and just store the key (filename / row id) in the session... Or, you can change the 'Session.save' in the same file, to cause Cake to automatically save session data to disk / database. Finally, if you set the 'Security.level' to 'medium' in /app/config/ core.php then the session id won't regenerate for every request, so you could just use that. On Apr 23, 3:04 am, MonkeyGirl <[EMAIL PROTECTED]> wrote: > Hi again! > > I'm using the session component, as documented > athttp://manual.cakephp.org/view/173/sessions, and it's storing and > retrieving all the session variables I set just fine. > > However, I'm trying to find the session ID - or anything else that's > unique to each visitor, but doesn't change each time they load a new > page - and I'm getting a bit stuck here. > > I've tried echoing out PHP's session ID, as documented > atwww.php.net/session_id > , but it seems to change each time a page is loaded. I'm assuming > CakePHP is doing magical things with sessions that I just shouldn't > interfere with lest I break something, but please correct me if I'm > wrong about that. > > So I looked at what $this->Session is storing, figuring that maybe > it's storing some kind of consistent ID somewhere. The closest I could > find was $this->Session->_userAgent , but that appears to just be a > hash of the browser name, nothing else, as someone else using the same > browser even on a different network will get the same value. > > So is there anything that acts like a regular, consistent session ID? > > If not, I can just set a hash of the user's browser, IP address, and > the current timestamp at the exact moment they visit the site and set > that as a regular session variable (ie each time the user loads a > page, check for this session variable, and if it's not set, generate > and set it), but that seems a bit long winded and a case of > reinventing the wheel when this is exactly what session IDs are for. > > Thanks for any suggestions, > Zoe. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---