I don't know about the problem you ask, but i can tell you storing a number of cookies in the user browser with user information it's not the best way to deal with session.
I point you out to a relatively famous column by
merlyn,
Basic cookie management where you find how to deal with cookies and session in a right way.
Also check
Apache::Session that despite the name works in every CGI environment.
$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g