Sessions set up<

liunx

Guest
I have WinXP, Apache, PHP and MySql running on my PC, and have no problems, except for the fact that I cant seem to get any sessions to work when I experiment with them ( I don't know much about them to start with, so I'm trying to learn ).

I've gone through a dozen scripts/programs and countless tutorials, but it never works, and I just get more confused because it isn't working. What I'm wondering is this...

1) Do I need to change anything in my Apache set up?
2) Are sessions stored in MySql, a folder, or text file ( and if all 3, which is best )?
3) Cookies...yes or no? And if I try to make a login/users page, aren't they needed?

Any help is appreciated as this is driving me crazy trying to figure it out.I'm new to this too and had a problem with sessions, I found out it was my tmp directory. Try making a tmp directory on your C: drive, I think that is where it looks by default. Not temp, but tmp. PHP uses this to write sessions too. You can change this location with php.ini also I think.

This worked for me. You will see your sessions are stored there afterwards.Just checked, the setting is session.save_path and the default is tmp. :)be default it looks in php folder, so make a tmp folder there and check that path. it might be

session.save_path = /tmpThis is how my current php.ini file is set up..

; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
session.save_path = "C:\tmp"

; Whether to use cookies.
session.use_cookies = 1

; This option enables administrators to make their users invulnerable to
; attacks which involve passing session ids in URLs; defaults to 0.
; session.use_only_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

My php folder doesn't have a tmp or temp folder but it does have a SESSIONS folder, which is empty. So, a dumb question before I change anything...is this where I want them, or make the new folder and change the php.ini file?I would make a new folder like I showed in my post. then take the C: out of the ini file and make it like my post.
 
Back
Top