The BoardMod Project
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum
BoardMod Support Forum
[ Home | Help | Search | Login | Register ]  

07.09.10 at 21:47:02, Welcome, Guest. Please Login or Register

Choose Language:
Page Index Toggle Pages: 1
Cookies/Directories (Read 507 times)
Dave Rapp
Hacker Wannabe
**
Offline

Cameron County, Pennsylvania, USA
Posts: 89



03.06.09 at 00:10:19  
Lateley I feel like I'm trying to set a record for most questions asked. Anyway, In an admin section of a script I'm putting together I'm using cookies for admin login as follows:
sub write_cookie{
print "Content-type: text/html\n";
print "Set-Cookie: usname='$in{'username'}'; expires=''Thursday, 1-Jan-1970 12:00:00 GMT;';\n";
print "Set-Cookie: psword='$in{'userword'}'; expires=''Thursday, 1-Jan-1970 12:00:00 GMT;';\n";
print "Set-Cookie: rank='$ref->{'rank'}'; expires='Thursday, 1-Jan-1970 12:00:00 GMT;';\n\n";
}


The problem is, the cookies are being written from one directory and for each directory above that I want to enter I'm having to write a cookie for that directory also(log in again). Thiings are great once I've logged in to each directory(and have a cookie for each directory. Is there some way to write a cookie(am I missing an ingredient) so that if, say, the cookie is written in the /admin directory it will also be valid in, say /admin/processing directory? I log into admin dir but when I go to enter the processing dir it makes me write another cookie(log in again).
 
IP Logged
 

If you choose not to decide you still have made a choice.
deti
Fulltime Hacker
***
Offline

Prien am Chiemsee, Bayern, Germany
Posts: 101



Reply #1 - 03.06.09 at 08:30:33  
Have you tryed with
path=/;
?

And what does the ; here:
....expires='Thursday, 1-Jan-1970 12:00:00 GMT;';....
?

Why do you write 3 times expires and not all in one line?:

print "Set-Cookie: usname='$in{'username'}'; psword='$in{'userword'}'; rank='$ref->{'rank'}'; path=/; expires='Thursday, 1-Jan-1970 12:00:00 GMT';\n\r\n\r";

Wink
 
IP Logged
 

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
Johann Wolfgang Goethe
Dave Rapp
Hacker Wannabe
**
Offline

Cameron County, Pennsylvania, USA
Posts: 89



Reply #2 - 05.06.09 at 13:36:01  
The biggest problem I had was the fact that the cookies weren't being read because of a goofup in the date format. Strange because they were showing  up in Opera but that was it. I'm still trying to figure out what the deal is as far as reading the cookies is but it has to be in the login script---next victim of attack. BTW---I noticed at the end of the string for setting the cookies you had \n\r\n\r What are the r's for--never saw that one before. Thanx---have a nice day, Dave Smiley
« Last Edit: 06.06.09 at 01:36:09 by Dave Rapp »  
IP Logged
 

If you choose not to decide you still have made a choice.
Page Index Toggle Pages: 1
© 2000-2009 by - All rights reserved.

SourceForge.net Logo
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum