The second condition in $s->is_expired && $s->param("logged_in")
looks suspicious. Would it be possible for you to use new and not bother with load? new should be able to handle all of these. You can check for your $s->param("logged_in") on whatever session new gives you, either loaded from an old stored copy, or a newly minted one.