Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 10-08-2006, 07:41 PM   #1
Intripita-MH
Senior Member
 
Intripita-MH's Avatar
 
Join Date: Sep 2006
Posts: 280
Intripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to behold
Send a message via AIM to Intripita-MH Send a message via MSN to Intripita-MH Send a message via Yahoo to Intripita-MH
Question Sessions or Cookies?

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
Intripita-MH is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 10-08-2006, 09:21 PM   #2
UnKnown
Moderator
 
UnKnown's Avatar
 
Join Date: Aug 2006
Posts: 1,128
UnKnown is just really niceUnKnown is just really niceUnKnown is just really niceUnKnown is just really niceUnKnown is just really nice
Default Re: Sessions or Cookies?

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.
UnKnown is offline  
Old 10-09-2006, 05:37 AM   #3
rohan2kool
Member
 
rohan2kool's Avatar
 
Join Date: Dec 2005
Posts: 132
rohan2kool will become famous soon enough
Default Re: Sessions or Cookies?

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.
rohan2kool is offline  
Old 10-10-2006, 04:04 AM   #4
kenni
Registered Member
 
kenni's Avatar
 
Join Date: Dec 2005
Posts: 1,543
kenni is a splendid one to beholdkenni is a splendid one to beholdkenni is a splendid one to beholdkenni is a splendid one to beholdkenni is a splendid one to beholdkenni is a splendid one to beholdkenni is a splendid one to beholdkenni is a splendid one to behold
Default Re: Sessions or Cookies?

rohan2kool is right. Your best bet is to use cookies.
__________________
Wanna thank someone? Give 'em a rep. More info.
kenni is offline  
Old 10-10-2006, 07:30 AM   #5
rohan2kool
Member
 
rohan2kool's Avatar
 
Join Date: Dec 2005
Posts: 132
rohan2kool will become famous soon enough
Default Re: Sessions or Cookies?

Quote:
Originally Posted by kenni View Post
rohan2kool is right. Your best bet is to use cookies.

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.
rohan2kool is offline  
Old 10-10-2006, 08:08 PM   #6
Intripita-MH
Senior Member
 
Intripita-MH's Avatar
 
Join Date: Sep 2006
Posts: 280
Intripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to beholdIntripita-MH is a splendid one to behold
Send a message via AIM to Intripita-MH Send a message via MSN to Intripita-MH Send a message via Yahoo to Intripita-MH
Default Re: Sessions or Cookies?

Ooo.. okay... what are pseudo sessions?
__________________
Intripita :: web hosting | development | conferencing

Business-Grade Web Hosting, Professional Conferencing, Effective Web Development by Intripita
Intripita-MH is offline  
Old 10-14-2006, 06:32 PM   #7
rohan2kool
Member
 
rohan2kool's Avatar
 
Join Date: Dec 2005
Posts: 132
rohan2kool will become famous soon enough
Default Re: Sessions or Cookies?

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.
rohan2kool is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Closed Thread

(Threads which have no activity for more than 30 days are automatically closed.)



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump


All times are GMT. The time now is 09:44 AM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.