does restarting apache reset php sessions?
Moderator: General Moderators
does restarting apache reset php sessions?
hullo ... novice here.
does restarting apache reset php sessions?
thanks!
does restarting apache reset php sessions?
thanks!
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: does restarting apache reset php sessions?
Yes. Why didn't you just try it? Or search Google?
Re: does restarting apache reset php sessions?
No
There are 10 types of people in this world, those who understand binary and those who don't
Re: does restarting apache reset php sessions?
thanks for the reply jay.
i tried it and i searched google too. but my results contradicted the expected results, hence i had to resort to an expert opinion (= you guys)
when i do a
apache is restarted but for some strange reason, the php sessions are preserved.
i tried it and i searched google too. but my results contradicted the expected results, hence i had to resort to an expert opinion (= you guys)
when i do a
Code: Select all
$ /opt/apache/bin/httpd -k restart
Last edited by kiwijones on Thu Feb 26, 2009 1:41 pm, edited 1 time in total.
Re: does restarting apache reset php sessions?
ok ... there's 1 'no' and 1 'yes' ... maybe i should take a poll? 
Re: does restarting apache reset php sessions?
Apache is an HTTP server. PHP manages user sessions.
And one could install Apache without installing PHP
There are 10 types of people in this world, those who understand binary and those who don't
Re: does restarting apache reset php sessions?
that makes sense.
thanks vlad!
thanks vlad!
Re: does restarting apache reset php sessions?
Code: Select all
cat /etc/cron.d/php4
# /etc/cron.d/php4: crontab fragment for php4
# This purges session files older than X, where X is defined in seconds
# as the largest value of session.gc_maxlifetime from all your php.ini
# files, or 24 minutes if not defined. See /usr/lib/php4/maxlifetime
# Look for and purge old sessions every 30 minutes
09,39 * * * * root [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm
There are 10 types of people in this world, those who understand binary and those who don't
Re: does restarting apache reset php sessions?
thanks for that info too vlad!
on a related note (this is more of a linux scheduling question), can you see *all* crontabs that a system is running (i mean not just for a particular user ... but all users and all processes)?
on a related note (this is more of a linux scheduling question), can you see *all* crontabs that a system is running (i mean not just for a particular user ... but all users and all processes)?
Re: does restarting apache reset php sessions?
You can't see the crond processes running because, crond forks a new process for every task only when it's needed - i.e. it's time to run it.
You can take a look of crond config files to determine what processes are to be run.
You can take a look of crond config files to determine what processes are to be run.
There are 10 types of people in this world, those who understand binary and those who don't
Re: does restarting apache reset php sessions?
VladSun wrote:You can take a look of crond config files to determine what processes are to be run.
Code: Select all
sudo ls /var/spool/cron/crontabs/| while read name; do echo '# User:' $name; sudo cat /var/spool/cron/crontabs/$name; done
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: does restarting apache reset php sessions?
I stand corrected.
Care to explain
I thought with PHP being a module inside Apache, restarting Apache would restart PHP, and reset the sessions. I'd of sworn that I've restarted Apache in the past to wipe sessions, but a test just now proves not. Where are the physical session files stored in a typical Apache/PHP install?
Care to explain
in more detail Vlad?Apache is an HTTP server. PHP manages user sessions.And one could install Apache without installing PHP
I thought with PHP being a module inside Apache, restarting Apache would restart PHP, and reset the sessions. I'd of sworn that I've restarted Apache in the past to wipe sessions, but a test just now proves not. Where are the physical session files stored in a typical Apache/PHP install?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: does restarting apache reset php sessions?
Take a look at your session_save_path php.ini variable.jayshields wrote:Where are the physical session files stored in a typical Apache/PHP install?
Re: does restarting apache reset php sessions?
Weirdan wrote:VladSun wrote:You can take a look of crond config files to determine what processes are to be run.Code: Select all
sudo ls /var/spool/cron/crontabs/| while read name; do echo '# User:' $name; sudo cat /var/spool/cron/crontabs/$name; done
cron searches its spool area (/var/spool/cron/crontabs) for crontab
files (which are named after accounts in /etc/passwd)....
...cron also reads /etc/crontab, which is in a slightly different format
(see crontab(5)). Additionally, cron reads the files in /etc/cron.d:
it treats the files in /etc/cron.d as in the same way as the
/etc/crontab file
There are 10 types of people in this world, those who understand binary and those who don't
Re: does restarting apache reset php sessions?
It's file storage (usually), so why to delete them on init? Deletion of this files is done by crond jobs - simple and easy to dojayshields wrote:I thought with PHP being a module inside Apache, restarting Apache would restart PHP, and reset the sessions.
There are 10 types of people in this world, those who understand binary and those who don't