I'm working on a project that requires sessions instead of cookies and I was wondering what a good way to secure them are? With cookies I would just do something like this:
$x = serialize(array('username', sha1('pwd')));
setcookie('cookieName', $x, time()+60);
...
$myCookie = unserialize($_COOKIE['cookieName']));
echo $myCookie[0];
But I'm not quite sure how to go about it with sessions.