The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> session.save path broken
Christian J
post Jan 5 2011, 10:44 AM
Post #1


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



(maybe this is the wrong sub-forum)

http://www.php.net/manual/en/ref.session.php#82987 wrote:

session.save_path="C:\DOCUME~1\pjs9486\LOCALS~1\Temp\php\session"

I was cleaning out the temp directory, and deleted the php directory. Session stuff quit working. I re-created the php directory. Still no luck. I re-created the session directory in the php directory, and session stuff resumed working.

I would have expected session_start() to have re-created directories in the path, if they didn't exist, but, it doesn't.

Note to self: Don't do that again!!!!


I apparently did the same thing during some recent Windows mainentance. Surely there must be a way to delete temporary files from your testing computer without having to recreate the session.save_path directories manually every time?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 8 2011, 01:12 PM
Post #2


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



I would expect that the new session would be written to disk when the current session closes either explicitly or on reaching the end of the script although I couldn't find a site that said so. I did find that the session is NOT written if there is no change to the session.

So: do you have an explicit session_write() instruction before the end of your script? And ... do you actually change the session data?

and

Why don't you put your session temp directory somewhere that doesn't have the word 'Temp' in the path?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 8 2011, 02:44 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(Ephraim F. Moya @ Jan 8 2011, 07:12 PM) *

I would expect that the new session would be written to disk when the current session closes either explicitly or on reaching the end of the script although I couldn't find a site that said so. I did find that the session is NOT written if there is no change to the session.

When an empty temp directory is there I get no PHP warning, even though nothing is written to the directory. Seems session_start() wants to open and check the temp directory even if it's empty.

QUOTE
So: do you have an explicit session_write() instruction before the end of your script?

I guess you meant session_write_close()? No. Would it matter if I have one, since it seems there must be a temp directory even if it's empty? Too bad PHP doesn't create a new one. Maybe I had to create it manually when I first started using sessions as well, can't remember. unsure.gif

QUOTE
Why don't you put your session temp directory somewhere that doesn't have the word 'Temp' in the path?

That's a thought. I'll try it.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 10:11 AM