Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Sessions, picking up where it left off?

session

  • Please log in to reply
7 replies to this topic

#1 phpforfun

phpforfun

    Speaks fluent binary

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1056 posts

Posted 22 June 2008 - 12:06 PM

Hello, ok so for my website, the proxy, im trying to get it as close to a real web browser as possible, id like to emulate the firefox option that lets you restore your previous session. For that I was going to try this:
//Update Session DB
if($username != "sample"){
$sessiondata = session_encode();
$sql = "UPDATE members SET `session`='$sessiondata' WHERE `username`='$username'";

mysql_query($sql) or die (mysql_error());
}


and then to continue it I was going to run:

session_decode($sessiondata);


and that would restore the information within the session.. however, when I record the data to the database, it records this:

username|s:9:"jhyland87";password|s:32:"f7f865a01003577395678c073d1759aa2";


Not the phpsessionid, which I believe contains all the proxified cookie information...

is it possible to pick up where you left off with a session? Just to restore the old session from the day before or something?
  • 0

#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 23 June 2008 - 08:08 AM

I believe you would have to use cookies to "restore" old sessions.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 phpforfun

phpforfun

    Speaks fluent binary

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1056 posts

Posted 23 June 2008 - 09:50 AM

I can't store the phpsessionid?
Posted via CodeCall Mobile
  • 0

#4 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 23 June 2008 - 01:13 PM

I don't think the browser will store the session ID. Mind you, this is based on my experience with ASP and ColdFusion.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#5 phpforfun

phpforfun

    Speaks fluent binary

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1056 posts

Posted 23 June 2008 - 04:31 PM

i see, well I need some php experts, I dont see why firefox can do it but I wouldnt be able to.. its stored in a tmp file, why cant I restore it in a tmp file later :)
  • 0

#6 phpforfun

phpforfun

    Speaks fluent binary

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1056 posts

Posted 23 June 2008 - 04:35 PM

ok, let me say what I think... You CAN store session data in a database, and recover it, thats a fact.. the code I posted proves it, however.. I dont just want the session data, I want the session ID, because thats what all the other proxified cookies link to...
  • 0

#7 John

John

    CC Mentor

  • Moderator
  • 4450 posts
  • Location:New York, NY

Posted 23 June 2008 - 07:02 PM

I have no clue, I haven't worked with sessions in over 10 months...
  • 0

#8 phpforfun

phpforfun

    Speaks fluent binary

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1056 posts

Posted 24 June 2008 - 08:52 PM

:( ok
  • 0





Also tagged with one or more of these keywords: session

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download