What are sessions and cookies in php and where are they stored?
I searched but I can\'t find the exact answer.
Cookies are stored in the browser, not in PHP. You can get the cookies the browser sent by looking in $_COOKIE['cookiename'], but as far as i know you can't set cookies like that -- you need to use setCookie(), or possibly header('Set-cookie: ...').
The sessions can be stored anywhere, but they're most often just files on your server's filesystem; your php.ini (or the ini_get() function) would probably be helpful in finding out where. Try:
$session_file_name = ini_get('session.save_path')."/sess_".session_id();