0

Where can I find the cookie that session_start uses?

  • It should be in the same place as all the other cookies your browser stores... – BoltClock Dec 25 '11 at 16:33
  • `print_r($_COOKIE);`, Firefox uses `cookie.sqlite` (as does Chrome), see also Preferences > Privacy > individual cookies. – mario Dec 25 '11 at 16:42
  • I highly doubt this has something to do with the cookies. I would take a hard look at your code first... – Derk Arts Dec 25 '11 at 16:46
  • @mario - so I would have to use a sql client to pull just a single id from a sql table..as per below...that is all that is contained on the client side? –  Dec 26 '11 at 17:31
  • Leave the browser cookie store alone. It's none of your business. There is a menu entry for looking at it. – mario Dec 26 '11 at 18:57

1 Answers1

2

For standard PHP sessions with default settings, you can get the cookie key/value with:

 session_name() -> session cookie's KEY
 session_id() -> session cookie's VALUE

However, note that whatever you write to $_SESSION is NOT stored in the cookie itself. The session cookie contains ONLY the session ID value. The data your write in $_SESSION is stored on the server - usually in a file, unless you've rolled your own session handlers and are storing it in a different manner.

Marc B
  • 356,200
  • 43
  • 426
  • 500
  • Because a session cookie by itself is innocent. But when that session cookie is served up by a 3rd party advertising network, that one cookie can track your movements across ANY sites you visit that use the same ad network. – Marc B Dec 26 '11 at 21:55