Twitter in Plain English
Saturday, June 28. 2008
This is why everyone should use twitter! If you don't know what it is, watch the video!
This is why everyone should use twitter! If you don't know what it is, watch the video!
PHP sessions are handy little things, however it's a bit tricky to correctly get a custom timeout to work correctly. There are a few key ini settings:
session.gc_probability - The probability that the garbage collector will run and clean up old session data. The default value is 1.
session.gc_divisor - The divisor to use with the probability. The default value is 100.
session.save_path - The path for session values to be saved. The default is /tmp, however it is important to change this to a custom folder for the application - especially if you are in a shared hosting enviorment. The garbage collector does not discriminate, and it will delete ANY session data that is older than the set limit, not just ones that correspond to your application.
session.cookie_lifetime - How long to keep the cookie written to the client machine valid. Defaults to 0, which means the cookie will expire at the end of the broswer session (at logout or when closing the broswer).
Now, before you start anything, make sure you have a writable folder setup for your application that you can use to store your session data.
Start your session with something smiliar to:
ini_set('session.gc_maxlifetime', '86400');
ini_set('session.gc_divisor', '1');
ini_set('session.gc_probability', '1');
ini_set('session.cookie_lifetime', '0');
ini_set('session.save_path', /path/to/sessions/myapp);
session_name('myapp');
session_start();
Setting the above configuration well make sure your session files are saveed in a seperate folder, they will expire in 24 hours, and the garbage collector will run everytime session_start is called to cleanup expired sessions.
The problem with alot of other infomormation is that they will suggest setting the cookie_lifetime to be the same as the gc_maxlifetime. The problem with this is that when the cookie value is set, the expiration date is not updated as the user continues to be active in the application. The session data on the server side is updated. So, if this is the case, after the value of cookie_lifetime has expired, even if the session data on the server was just updated, your session will be invalid, and you will be required to login again.
I hope that this post will help someone else in the quest to conquer the php session timeout. It definitely is not very clear, and can be very confusing!
Over the weekend, I decided to develop a plugin for serendipity that would allow for the easy addition of the email subscription form or link into the sidebar. As I look at feedburner more, I will most likely add more functionality into the plugin.
The plugin is available in Spartacus for download!
Direct download: zip
The initial release of the Htaccess Authentication Manager (htauthman) has just been zipped up and published to SourceForge. Everyone is encouraged to try it out and let me know if you run into any issues! It has been heavily tested, and is already in use so it should be pretty rock solid. It does require php 5.2, but that's about it!
A special thanks to Jamie Overman for whipping up the design!
SourceForge Project: http://sourceforge.net/projects/htauthman/
User Access control is a pain in the ass. It's pretty easy to turn it off, you can just use the TweakUAC app to totally disable it - http://www.tweak-uac.com/download/
To disable the stupid security warnings, you need to do the following:
1. Use a registry editing tool to navigate to the following
key:
2. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center
Finally! It looks like it could be true! TLC & Discovery HD
T’was the Night Before Christmas
and all through Woot Tower,
the staff seemed to be cross
and they grumbled and glowered.
“What’s wrong, there?” called The Boss
from his executive suite.
“You better get merry
or you’re gonna get beat!”
“No, The Boss, we’re sorry!
There’s just so much stuff!
We’ve got six hundred mousepads
we have to clean up!”
“The ones with the eagle?”
said The Boss from on high.
“Maybe I’ve been too harsh
on you hard-working guys.”
The Boss looked in his pocket
(all satin and silk)
and pulled out his fancy watch
that he had custom built.
“It’s not yet midnight
in the Central Time Zone!
Maybe there’s still a way
we can get you guys home!”
“Home for Christmas?” they yelled
with excitable glee.
“Oh, our wives and our children
would us love to see!”
“Well let’s get right to work!”
said The Boss with true grit.
“I’ll roll up my sleeves
and help out with this sh-
NATIONAL WEATHER SERVICE UPDATE: SANTA NOW TRACKED TO BE CLOSE TO YOUR SPECIFIC NEIGHBORHOOD. ALL CHILDREN SHOULD PROCEED TO BED. STAY TUNED FOR FURTHER UPDATES AS WARRANTED.
“Oh, sir, you can’t say that!”
the workers explained.
“Naughty words on the Internet
make our customers faint!”
“Aw, darn it all!” said The Boss,
his heart full of disdain.
“Maybe we should just leave
this stuff out in the rain!”
Just then was a rustle
And the sound of some deer.
All rushed to the window
To see what was now here.
“Ho ho!” came the sound
of a voice deep and low.
Then a brief pregnant pause.
Then finally a soft “Ho!”
“Santa!” cried the workers
as they ran to the sled.
“I want a Robosapien!”
“I want pistachios instead!”
“I want a Mustek camera!”
“A wrist radio’d be good!”
But Santa walked quickly to
where The Boss sadly stood.
“Oh, Santa,” said The Boss,
“I just have too much stuff!
I’d get rid of it cheaply
But my language is too rough!”
Santa gave a big smile,
pulled The Boss on his lap,
and whispered three simple words:
“Stocking of Crap.”
The Boss leaped in the air
as though shot from a gun
“Everyone to the warehouse!
We’ll have so much fun!”
And they packed through the night
with traditional rules
(that I’m sure you recall
for you’re surely not fools).
YOU’LL WASTE MONEY ON SHIPPING
IF YOU DON’T ORDER THREE
YOU’RE RESPONSIBLE FOR PICKING
YOUR OWN QUANTITY
YOU HAVE TO PICK 3
AS THE AMOUNT WE WILL SEND YOU
YOU’LL STILL GET JUST ONE BAG
NO MATTER WHAT YOU DO
BUT THE CRAP THAT’S INSIDE IT
IS WHAT YOU’RE SELECTING
AND YOU’LL WISH YOU GOT THREE
IN POST-PURCHASE REFLECTING
So make The Boss happy
And help us clear out our business
And all of us here at Woot
wish you guys Merry Christmas.
THE HOLY CRAP COMMANDMENTS v2.0:
I. Thou shalt expect nothing beyond one bag of some kind and your chosen quantity of crappy items (which should be THREE).
II. Thou shalt not whine and complain when some people’s crap turns out to be nicer than yours.
III. Thou shalt take a moment to consider whether you might be better off just not buying this crap.
IV. Thou shalt not order just one crap and blame it on anything but your own inattention.
V. To paraphrase Stephen Stills, shalt thou not get the crap you want, want the crap you get.
So, I am again considering going to CES (Consumer Electronics Show) in January. Show floor admission is free. Is anyone insterested?