|
| |||||||
![]() | Welcome to iWEBTOOL Talk, where you talk about
webmaster-related stuff.
1 Register
2 Browse the board
3 Discuss whatever may interest you! | |||||||||||||
![]() |
| | Thread Tools | Search this Thread | Display Modes |
| | #1 |
| Senior Member | I need to know if you use sessions or cookies more to track user logins... while a user is logged in, do you have a session variable store the username? the user ID? or what? If cookies, same thing - how do you check to see if a user is logged in? (I know how to do all of this already, this is more of a survey, rather.) Thanks .chulium.
__________________ Intripita :: web hosting | development | conferencing Business-Grade Web Hosting, Professional Conferencing, Effective Web Development by Intripita |
| |
|
| |||||||
| | #2 |
| Moderator Join Date: Aug 2006
Posts: 1,128
![]() ![]() ![]() ![]() ![]() | I use both cookies and sessions for tracking my client logins. Unfortunatly, i do not know the specifics of how it tracks the user login.
__________________ Webmaster Resources & Forums / Webmaster Tools & Forum / eCommerce Shopping Basket / Scene Releases |
| |
| | #3 |
| Member Join Date: Dec 2005
Posts: 132
![]() | sessions don't work without cookies. When u make a session, php makes cookie called PHPSESSID into your client's desktop... so basically, if you're trying to evade cookies, there's no way u can use both. as for ease, it's better to use cookies. I've never used sessions, but rather i've used cookies and mysql databases to make psuedo sessions.
__________________ Eat healthy, Stay Fit, Die Anyway. --==-- If there is a man who knows everything about women, there is a Windows distribution without bugs. |
| |
| | #5 |
| Member Join Date: Dec 2005
Posts: 132
![]() | i'm always right ![]()
__________________ Eat healthy, Stay Fit, Die Anyway. --==-- If there is a man who knows everything about women, there is a Windows distribution without bugs. |
| |
| | #7 |
| Member Join Date: Dec 2005
Posts: 132
![]() | well.. nothing as 'pseudo sessions' actually exist.. i've coined that word to tell what i actually do... 'psuedo' means false, so psuedo sessions is something that emulates php sessions.. but in a more persistent way. What i do is, whenever a user visits my site, he is categorized as a 'first time visitor' or a 'visitor' i.e if there is a cookie on his site with a name, let's say u_visit_this_site, he's a first time visitor, otherwise, a visitor. The value of the cookie is actually a randomly generated 64 digit hexadecimal string. I do it by md5()ing two randomly generated numbers and then concatening them. When the user is a first time visitor, a cookie is set using the cookie() function. The name of the cookie is u_visit_this_site and the value would be, a 64 digit hexadecimal string like: '0ec3d867002e7da0e75c898a89bc40977012ef0335aa2adba b58bd6d0702ba41'. Now, what i do is, make a corresponding entry in a MySQL table, where there is a field called 'session_id' and other fields, which are actually session variables. If you are not categorized as a first time visitor, the cookie picks up the session id, and then searches the database for a matching entry, from where it loads all the variables required. that's all ![]()
__________________ Eat healthy, Stay Fit, Die Anyway. --==-- If there is a man who knows everything about women, there is a Windows distribution without bugs. |
| |
(Threads which have no activity for more than 30 days are automatically closed.) |
| Quick Reply | ||
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|