|
|
| Author |
Message |
< Yaws mailing list ~ added new callback to yaws_rpc.erl |
| tobbe |
Posted: Fri Dec 29, 2006 6:42 pm |
|
|
|
User
Joined: 19 Jan 2005
Posts: 274
Location: Stockholm, Sweden
|
In CVS, I have just added a call to:
M:F(cookie_expire)
from the yaws_rpc.erl module.
This callback function is expected to return a proper
cookie expire string. If the function is non-existant,
the default behaviour will prevail as of today, i.e the
cookie will only live during the session.
I have updated json_intro.yaws too.
Cheers, Tobbe
(Ps. Perhaps the following function could be worthy of be added to yaws_api.erl ?)
cookie_expire_now_plus_hour(Hour) when integer(Hour) ->
DT = calendar:now_to_universal_time(erlang:now()),
{Date, {H,Mi,S}} = calendar:gregorian_seconds_to_datetime(
calendar:datetime_to_gregorian_seconds(DT) + 3600*Hour),
{Y,Mo,D} = Date,
Day = day(calendar:day_of_the_week(Date)),
Month = month(Mo),
Day++", "++i2l(D)++" "++Month++" "++i2l(Y)++" "
++i2l(H)++":"++i2l(Mi)++":"++i2l(S)++" GMT".
month(1) -> "Jan";
month(2) -> "Feb";
month(3) -> "Mar";
month(4) -> "Apr";
month(5) -> "May";
month(6) -> "Jun";
month(7) -> "Jul";
month( -> "Aug";
month(9) -> "Sep";
month(10) -> "Oct";
month(11) -> "Nov";
month(12) -> "Dec".
day(1) -> "Mon";
day(2) -> "Tue";
day(3) -> "Wed";
day(4) -> "Thu";
day(5) -> "Fri";
day(6) -> "Sat";
day(7) -> "Sun".
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|