|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need Help saving sessions!
Hello,
I'll pose my question as simply as possible, as I do respect your time. I have a user login form on my site. I need to save the session id to my database when a user registers for a username and password. I need this because in a different table I will store book information that corresponds to the same session id that exists in the "users" table. Basically, I need to know how to save the session ID upon user registration & how to call it when they login, so that I can show the user the books they've posted when they login. A good example of this can be found on my site at URL This site was programmed with Lasso, and I'm trying to reprogram it with PHP. To make things more clear. Also Yes, Sorry for being unclear.. I need to send the session ID of the newley registered user to mysql database, then, when they login at a different date and time, I need to pull the same session ID that was entered with the registration information (username, pass ect...) If you're wandering why, it's because when the user logs in, they will be able to post text-book info. This text-book info will be related to their session ID which will also be the same session ID as the one in the "users" table. Example: Database "bookstorebandits: Table "users": Session ID, Username, Password, First Name, Last Name, Email, Table "books: Session ID, Date, Title, Author, ISBN, Price, Here's my current website biult using .lasso, I'm trying to biuld my own using .php. So I need to learn how to do what my programmer did to make my site. Thanks for any input that you have ...it is very appreciated. James Thanks in advance! |
|
#2
|
||||
|
||||
|
Look up session_set_save_handler at php.net and within the tutorials here and at other sites like Zend. This allows you to override the default session handler and log sessions to a database. You'll have to write a little class to handle the session handling, but it shouldn't be too hard to find one of those already out there (I did at one point, but I don't remember where I found it). This'll allow you to have mysql handle sessions (arguably safer than having them stored in /tmp anyway) and to validate session ids against user accounts, etc.
|
|
#3
|
|||
|
|||
|
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Need Help saving sessions! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|