aitchsonpeter Posted April 6, 2009 Share Posted April 6, 2009 I want to create a database which will record login cookies to a logged in user. Maybe even a record cookie button that will record the cookies open in a session and set them to open every session. I am very new to this but am learning quickly. Any help is appreciated but please treat me like a child. A slow one at that. The kid who eats glue. Remember him. Yea that one. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/ Share on other sites More sharing options...
aschk Posted April 6, 2009 Share Posted April 6, 2009 I think I might be misunderstanding here, (or perhaps you're not sure what cookies are for). But you want to store cookies in your database. Why? And which cookies? Cookies are to be used to store information on the client's machine, which can then be read by your PHP scripts when they access your site. Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-802152 Share on other sites More sharing options...
aitchsonpeter Posted April 6, 2009 Author Share Posted April 6, 2009 I want to be able to load the same cookie on another machine from a remote location. i.e. computer 1 log into webmail and cookie records log in info and posts to sql database computer 2 log into sql data base and go to webmail and cookie logs in to webmail. Log into database at work/cafe/school and all my cookies from home get loaded into the session file. Ya dig? Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-802162 Share on other sites More sharing options...
aschk Posted April 6, 2009 Share Posted April 6, 2009 In both instances (1) and (2) that you posted you require the user to log in ( via a web interface i'm guessing ). So where's the problem? Assuming you storing some information (dob, name?) on the user in your databases and the user is logged in (are you using sessions??) you don't need to store any cookies unless you need some information to persist on the client machine. I'll just re-state; you're making the user login regardless of their location so you don't need to facilitate any magical cookie movements. Ya dig? Perhaps if you explain better what it is these "cookies" are supposed to be doing then maybe we can shed some light on the real issue. Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-802274 Share on other sites More sharing options...
aitchsonpeter Posted April 6, 2009 Author Share Posted April 6, 2009 Perhaps I am not asking the right question. How can I log into my website via a php login script, and then access, through said website, multiple webmail applications without filling in username or password. That is to say, how can I perform a similar task as a cookie on a machine, except have the php login account be the similar point of contact rather than the machine. Can I attach a hotmail and gmail "cookie" for lack of a better word, to the user account so that when that users profile opens so does their hotmail account. An furthermore, were that user to tpye http://www.gmail.com in to the address bar the browser would navigate to their personal gmail account with out being prompted for a password, just as it would had a cookie been stored on that machine. Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-802497 Share on other sites More sharing options...
aitchsonpeter Posted April 10, 2009 Author Share Posted April 10, 2009 Is this a difficult question? If so why? Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-806776 Share on other sites More sharing options...
fenway Posted April 14, 2009 Share Posted April 14, 2009 You'd have to send the cookie in the headers... this is SO not a mysql question. Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-809841 Share on other sites More sharing options...
aitchsonpeter Posted April 19, 2009 Author Share Posted April 19, 2009 I would like to create a mysql database with multiple users and specific information for each user stored in a database format. When said user logs into the site through their php mysql database a series of cookies(stored on the mysql database) will be loaded into the header of a redirect page that brings them back to the site. At this point the cookies will have been loaded on the machine. When the user logs out the cookies will be wiped from the machine. User will then go to the library, log into website where php mysql database is again accessed and it loads cookies into the header of a page with a redirect to the site and the same experience is had on said library computer. User then logs off and cookies are wiped. I would like to store data in a database. That data will then be used to perform a function. In this case the data will be loaded into a header. Can any body help me rather than finding reasons not to? Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-813996 Share on other sites More sharing options...
jackpf Posted April 19, 2009 Share Posted April 19, 2009 If you use sessions, you can use the same session id on a different pc. For example, if you log in and get the session id 8234jkhkasfh, if you then go to a different pc and go to a page on your site and put ?phpsessid=8234jkhkasfh in the url, you'll have the same session. Is this what you're asking? Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-814045 Share on other sites More sharing options...
aitchsonpeter Posted April 19, 2009 Author Share Posted April 19, 2009 Thank you so much. This is a very helpful start yes. Can I hide that sess ID in the code of the page? And can I keep it in a directory in the database that will load it into the page code? Quote Link to comment https://forums.phpfreaks.com/topic/152760-cookie-database/#findComment-814071 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.