Problems with serialize and unserialize

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

Albino

Munky DesignsEstablished Member
Impact
17
EDIT: bah, ive posted in the wrong section, can a mod move to programming please :)

hey,

ok, I am saving 2 values in my cookie, like so:

Code:
$cookie = @serialize(array($u, $c));
setcookie("siteLogin", $cookie, time() + 36000, "/");

$u is username, $c is a cookie value (this is part of a remember script for logins).

now, when I come to extract it, I have this:

Code:
if (isset($_COOKIE['siteLogin'])){

    echo $_COOKIE['siteLogin']."<br />";
    echo unserialize($cookie)."<br />";
    list($u, $c) = @unserialize($cookie);
    echo "username: ".$u."  cookie: ".$c;

}

the echo is just for debugging, ive checked if the cookie contains a value, it does (and looks serialized). I can;t echo it unserialized or listed, am I doing something wrong?

here is a test url:

http://munkydesigns.co.uk/ScrtipsNew/login.php

u: username
p: password

make sure you check remember me lol

thanks in advance :)
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Each character of a domain name in its own box, with how to type one of them
Bookmarks: see bookmarks without a label
You can now show only the bookmarks you have not labeled. Open the label filter in the Bookmarks tab of your account menu, or on your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back