Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping track of sessions

Status
Not open for further replies.

kasuals

Programmer
Apr 28, 2002
100
US
Well, since my entire project is basically PHP I'd like to handle sessions in PHP as well.

What would be the best way to handle a login session in PHP? I want to keep track of users, and make sure that after a timeout of (x) they are logged out, and kill the session if they are logged out.

I haven't done much research yet, I figured I would pose the question to my peers to get a few suggestions of the best method before researching.

Thanks in advance.

- "Delightfully confusing..." raves The New York Times

-kas
 
Sleip:

I read a few posts back about session security. Should I just stick to using cookies in your opinion?

- "Delightfully confusing..." raves The New York Times

-kas
 
Yeah, PHP will do cookie-based or URL-based sessions.

According to the online manual page I posted earlier, URL based session management has additional security risks compared to cookie based session management. Users may send an URL that contains an active session ID to their friends by email or users may save an URL that contains a session ID to their bookmarks and access your site with the same session ID always, for example.[/u]

Want the best answers? Ask the best questions: TANSTAAFL!
 
Thats kind of what I figured. Awesome, thanks for the link, I'll read up on it.

Appreciate your thoughts.

- "Delightfully confusing..." raves The New York Times

-kas
 
Silly question here:
What if a user has their cookies turned off?
Are there any methods of passing variables between PHP scripts without using a cookie?

Thanx in advance,

Neil
 
neilyalowitz:

The answer is: YES.
It's really not PHP, but you would pass hidden fields that are written on every sucessive page. That way you could pass the values on to a script that is accessed via POST or GET.
If it's accessed via a link, the values are gone (unless the link has GET parameters).

If a user has cookies turned off, I'd tell him/her to turn cookies on, or not use the service.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top