tags:

views:

55

answers:

4
 $_session['user_id']=4;

Where this values of session is saved.. means in some file?? where??

A: 

By default I think php stores its session information on the server, although you can override this to store session information in cookies on the client side.

jaltiere
Storing "session" data in cookies is pointless.
Crozin
And yes, I believe this information is stored in a file on the server using a generated alphanumeric string as it's name. (this is the PHPSESSID, and you can choose where the file is stored using the session_save_path method)
jaltiere
@Crozin: I didn't say it was a good idea, I just said it was possible. :)
jaltiere
+2  A: 

Isn't it in a temp file in session.save_path, whatever that is set to?

You might also find the answer you want in more detail here.

MJB
+2  A: 

Yes, they are stored in a temporary file somewhere on the server your website resides on. You can specify that setting in php.ini with session.save_path.

You could also use the function session_save_path to set and get session path from your script.

Syntax:

string session_save_path ([ string $path ] )

session_save_path — Get and/or set the current session save path

Sarfraz
A: 

PHP saves sessions in files. The location of these files is determined in php.ini by the session.save_path setting.

Matijs