Jump to content

Archived

This topic is now archived and is closed to further replies.

Adthegreat

Cookies Or Sessions

Recommended Posts

Hey!

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.

Share this post


Link to post
Share on other sites
session_set_cookie_params() accepts two parameters -- timeout and the cookie path [if your session uses cookies].

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.