Permalink
Browse files

wrote the shopppingcart example

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@191 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
klacke committed Oct 6, 2002
1 parent 951bf0e commit 87b14560d250973ef27ecfc6b50522ade28f22cf
View
@@ -50,16 +50,3 @@
-
-%% portal server has a queue of these
--record(ysession,
- {cookie, %% the cookie assigned to the session
- auth, %% the #auth structure as returned from portal_auth
- to, %% greg secs untill timeout death
- user, %% The user name
- passwd, %% And the passwd of that user
- starttime, %% When calendar:local_time() did sess start
- opaque %% any data the user supplies
- }).
-
-
View
@@ -249,18 +249,24 @@ Example usage could be:
.TP
-\fBnew_cookie_session(User, Passwd, Opaque)\fR
+\fBnew_cookie_session(Opaque)\fR
Create a new cookie based session, the yaws system will set the
-cookie.
+cookie. The new randomgenerated cookie is returned from this
+function. The Opaque argument will typically contain user data
+such as username and password
.TP
-\fBcookieval_to_session(CookieVal)\fR
+\fBcookieval_to_opaque(CookieVal)\fR
.TP
\fBprint_cookie_sessions() \fR
+
+.TP
+\fBreplace_cookie_session(Cookie, NewOpaque)\fR
+
.TP
-\fBreplace_cookie_session(Session, User)\fR
+\fBdelete_cookie_session(Cookie)\fR
.TP
View
@@ -19,10 +19,10 @@
-export([find_cookie_val/2, secs/0, url_decode/1]).
-export([get_line/1, mime_type/1]).
-export([stream_chunk_deliver/2, stream_chunk_end/1]).
--export([new_cookie_session/3,
- cookieval_to_session/1,
+-export([new_cookie_session/1,
+ cookieval_to_opaque/1,
print_cookie_sessions/0,
- replace_cookie_session/2]).
+ replace_cookie_session/2, delete_cookie_session/1]).
-export([setconf/2]).
%% these are a bunch of function that are useful inside
@@ -617,21 +617,22 @@ stream_chunk_end(YawsPid) ->
-
-new_cookie_session(User, Passwd, Opaque) ->
- yaws_session_server:new_session(User, Passwd, Opaque).
+%% Return new cookie string
+new_cookie_session(Opaque) ->
+ yaws_session_server:new_session(Opaque).
%% as returned in #ysession.cookie
-cookieval_to_session(CookieVal) ->
- yaws_session_server:cookieval_to_session(CookieVal).
+cookieval_to_opaque(CookieVal) ->
+ yaws_session_server:cookieval_to_opaque(CookieVal).
print_cookie_sessions() ->
yaws_session_server:print_sessions().
-replace_cookie_session(Session, User) ->
- yaws_session_server:replace_session(Session, User).
-
+replace_cookie_session(Cookie, NewOpaque) ->
+ yaws_session_server:replace_session(Cookie, NewOpaque).
+delete_cookie_session(Cookie) ->
+ yaws_session_server:delete_session(Cookie).
%% to be used in embedded mode, make it possible
Oops, something went wrong.

0 comments on commit 87b1456

Please sign in to comment.