Jump to content


Cookies Or Sessions

  • Please log in to reply
2 replies to this topic

#1 Adthegreat

  • Members
  • PipPip
  • Member
  • 16 posts

Posted 26 March 2006 - 12:20 AM


I'm making a php/mysql based website, and an important part of said website, is the access to certain pages. I have to limit the viewing of the pages per user to every 5 minutes or so.

Now, i know how to do this using cookies, however cookies can be deleted from the user's browser thus giving them access to the restricted page whenever they are willing to delete their cookies.

Is there any way i could use Session's to avoid this problem. I have looked around a bit and can not find anywhere about session's expiring after certain periods of time like the:

"time()+300" with cookies.

and even if you can, can you just close the browser to start a new session every time they want to view the page.

The only other alternate would be for me to make a "Time" table on my MYSQL database, but that would probably mean alot of comparision's and query's which could only slow the whole website down.

Any thoughts on this would be greatly appreciated!

Yours faithfully, Adthegreat.

#2 azuka

  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 26 March 2006 - 01:04 AM

session_set_cookie_params() accepts two parameters -- timeout and the cookie path [if your session uses cookies].

Given enough eyeballs all bugs are shallow. My Website

#3 Adthegreat

  • Members
  • PipPip
  • Member
  • 16 posts

Posted 26 March 2006 - 10:03 AM

But could this session be exited by exiting the browser, thus negating the time limit?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users