I'm thinking about using sessions in a new comminity site I'm putting together. I've always just used MySQL and Cookies before for user accounts and cutomisation etc, which seems to work fine.
I'm currently running through the documents and stuff on Sessions but have a question..
Once someone has logged in and their session variables have all been loaded how the hell do you take this info over to another page on the site?
Do you close the session on the current page and then re-open it on the next?
I know about the <? SID?> thing but when I use this in a link to the next page and try to then close the session I'm told the session isn't open.
Any advise or 'human readable' tutorials would be good.
Thanks.
The World of Sessions.
Moderator: General Moderators
By going
You will carry over what is in those sessions. To test it just echo out one of the entries in you session. Make sure you put the session_start(); before any other information though.
Code: Select all
<?php
session_start();
// whatever else
?>- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
You will have to save this information in a cookie, database, or some other means of storage. Sessions were built for on-the-fly kind of things, not for long term storage.Gen-ik wrote:Ah.. so simple. It now works
Oh.. just one more small thing.. how do you save the current session and then retrieve the data next time the member logs-on?
I'm a muppet.
Thanks again.