Sessions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
feiticeir0
Forum Newbie
Posts: 8
Joined: Tue Nov 05, 2002 1:33 pm
Location: Castelo Branco, Portugal

Sessions

Post by feiticeir0 »

HI !

i wonder,
how to pass to another page the session ?

it goes on the URL, so, by the link ?
example:

<a href="page.php" . Session ID ? or something ?

and then, in the other page i got access to session variables ?

regards, Bruno Santos
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

session

Post by AVATAr »

you don´t pass the session you mantain the session with: session_start(); in the top of the page.

You retrive a session var: $HTTP_SESSION_VARS["variable"]
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

If you have enable-trans-sid enabled then php will add it to your url's if it can't set the cookie. You still need to add it to any Header commands.

to add it to the url append the constant SID to your url's
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Code: Select all

<a href="something.php?PHPSESSID=<?php $HTTP_SESSION_VARS["variable"] ?>&something=something">
So the format is:-

something.php?something=something1&somewhat=somewhat
Post Reply