Jump to content


PHP Sessions


6 replies to this topic

#1 JoeVincetti

    Young Padawan

  • Members
  • Pip
  • 82 posts

Posted 19 July 2005 - 01:47 PM

I am using sessions to carry variables from page to page. When I try carrying the session over 2 or 3 pages, the session dies. Is there a reason for this?

Also, why do some sites contain what i think the session id is, in the url?

#2 Apollo

    Young Padawan

  • Members
  • Pip
  • 6 posts

Posted 19 July 2005 - 02:25 PM

Could you show us your script of sessions? we'll try to help you!

and i think that what you can see in the urls are just informations with the method 'GET'.
it's like POST but actions are shown in the url!

for example : index.php?act=Post&CODE=02&f=10&t=9300 ( extract from p2l :) )

sorry if i didn't answer the question very well!

#3 Jaymz

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 4,104 posts

Posted 19 July 2005 - 02:33 PM

Some sites have something like this:

index.php?sid=e3ae36bb955b9def13fc7c53b3f7d44a

Which is the session id appended to the url :) Make sure that there is

<?PHP ob_start(); ?>

At the beginning of the pages ;)

#4 JoeVincetti

    Young Padawan

  • Members
  • Pip
  • 82 posts

Posted 19 July 2005 - 03:40 PM

Jaymz, on Jul 19 2005, 07:33 PM, said:

Make sure that there is

<?PHP ob_start(); ?>

At the beginning of the pages :)
is this the same thing as ob_start();?

//start session
session_start();


#5 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 19 July 2005 - 03:42 PM

technically you don't need the ob_start :)
You need session_start.

Go to php.net and see what they have to say about sessions.

#6 Jaymz

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 4,104 posts

Posted 19 July 2005 - 03:43 PM

I was close :)

#7 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 19 July 2005 - 08:53 PM

Well, you should know that close in php just doesn't cut it :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users