LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-21-2007, 09:52 PM   #1
JEFFPINCT
LQ Newbie
 
Registered: Apr 2007
Posts: 1

Rep: Reputation: 0
SET UP USER AUTHENTICATION with COOKIES - EASIEST METHOD\SOFTWARE??


This is important & I need an answer soon!

I have a linux hosted website. I need to be able to check existing users for a cookie or deny access completely. Also I need each placed cookie to expire 12 hrs after creation.

How do I do this the easiest way? Please be gentle - I am very NEW at this....
 
Old 04-21-2007, 11:31 PM   #2
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
Was the site developed with a server side scripting language such as PHP? Best way to handle the cookies would be to manipulate cookies with the relevant language. For example, with PHP you can use the setcookie() function.

setcookie($name,$value,<expire time (epoch)>);
 
Old 05-04-2007, 06:59 PM   #3
tniemela
LQ Newbie
 
Registered: May 2007
Location: Finland
Distribution: Debian 6.0
Posts: 9

Rep: Reputation: 0
Quote:
Originally Posted by JEFFPINCT
This is important & I need an answer soon!

I have a linux hosted website. I need to be able to check existing users for a cookie or deny access completely. Also I need each placed cookie to expire 12 hrs after creation.

How do I do this the easiest way? Please be gentle - I am very NEW at this....
I would not recommend any cookie authentication for any sensitive data. Cookie authentication can be easily bybassed and even your cookies can be stolen easily.

But here is simple example for PHP:

<?php
if(!isset($_COOKIE['mycookie']))
{

echo "<center><font color='666666'>No auth because no valid cookie found!</font></center>";
exit(0);
}
?>

Script expect user to have cookie set named: mycookie

Not set, no access
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Easiest way to set up a proxy server? LinuxBlackBox Linux - Networking 3 10-28-2008 09:50 PM
Gaim: Server does not use any supported authentication method nazarioz Linux - Software 8 08-25-2006 04:21 PM
Gaim+GTALK: Server does not use support any authentication method introuble Slackware 6 07-23-2006 04:33 PM
which is the easiest authentication module for proftpd in suse 10.0? noorudin Linux - Software 0 06-25-2006 05:02 AM
easiest way to set up nfs Nappa Slackware 6 12-31-2003 05:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration