colas@0: head 1.1; colas@0: access; colas@0: symbols; colas@0: locks; strict; colas@0: comment @# @; colas@0: colas@0: colas@0: 1.1 colas@0: date 2008.01.22.03.21.31; author TWikiContributor; state Exp; colas@0: branches; colas@0: next ; colas@0: colas@0: colas@0: desc colas@0: @buildrelease colas@0: @ colas@0: colas@0: colas@0: 1.1 colas@0: log colas@0: @buildrelease colas@0: @ colas@0: text colas@0: @---+ Package == colas@0: *extends* CGI::Session::ErrorHandler colas@0: colas@0: colas@0: %TOC% colas@0: =head1 NAME colas@0: colas@0: CGI::Session - persistent session data in CGI applications colas@0: colas@0: =head1 SYNOPSIS colas@0: colas@0: # Object initialization: colas@0: use CGI::Session; colas@0: $session = new CGI::Session(); colas@0: colas@0: $CGISESSID = $session->id(); colas@0: colas@0: # send proper HTTP header with cookies: colas@0: print $session->header(); colas@0: colas@0: # storing data in the session colas@0: $session->param('f_name', 'Sherzod'); colas@0: # or colas@0: $session->param(-name=>'l_name', -value=>'Ruzmetov'); colas@0: colas@0: # flush the data from memory to the storage driver at least before your colas@0: # program finishes since auto-flushing can be unreliable colas@0: $session->flush(); colas@0: colas@0: # retrieving data colas@0: my $f_name = $session->param('f_name'); colas@0: # or colas@0: my $l_name = $session->param(-name=>'l_name'); colas@0: colas@0: # clearing a certain session parameter colas@0: $session->clear(["l_name", "f_name"]); colas@0: colas@0: # expire '_is_logged_in' flag after 10 idle minutes: colas@0: $session->expire('is_logged_in', '+10m') colas@0: colas@0: # expire the session itself after 1 idle hour colas@0: $session->expire('+1h'); colas@0: colas@0: # delete the session for good colas@0: $session->delete(); colas@0: colas@0: =head1 DESCRIPTION colas@0: colas@0: CGI-Session is a Perl5 library that provides an easy, reliable and modular session management system across HTTP requests. colas@0: Persistency is a key feature for such applications as shopping carts, login/authentication routines, and application that colas@0: need to carry data across HTTP requests. CGI::Session does that and many more. colas@0: colas@0: =head1 TRANSLATIONS colas@0: colas@0: This document is also available in Japanese. colas@0: colas@0: =over 4 colas@0: colas@0: =item o colas@0: colas@0: Translation based on 4.14: http://digit.que.ne.jp/work/index.cgi?Perldoc/ja colas@0: colas@0: =item o colas@0: colas@0: Translation based on 3.11, including Cookbook and Tutorial: http://perldoc.jp/docs/modules/CGI-Session-3.11/ colas@0: colas@0: =back colas@0: colas@0: =head1 TO LEARN MORE colas@0: colas@0: Current manual is optimized to be used as a quick reference. To learn more both about the philosophy and CGI::Session colas@0: programming style, consider the following: colas@0: colas@0: =over 4 colas@0: colas@0: =item * colas@0: colas@0: L - extended CGI::Session manual. Also includes library architecture and driver specifications. colas@0: colas@0: =item * colas@0: colas@0: We also provide mailing lists for CGI::Session users. To subscribe to the list or browse the archives visit https://lists.sourceforge.net/lists/listinfo/cgi-session-user colas@0: colas@0: =item * colas@0: colas@0: B - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt colas@0: colas@0: =item * colas@0: colas@0: L - standard CGI library colas@0: colas@0: =item * colas@0: colas@0: L - another fine alternative to CGI::Session. colas@0: colas@0: =back colas@0: colas@0: =head1 METHODS colas@0: colas@0: Following is the overview of all the available methods accessible via CGI::Session object. colas@0: colas@0: =head2 new() colas@0: colas@0: =head2 new( $sid ) colas@0: colas@0: =head2 new( $query ) colas@0: colas@0: =head2 new( $dsn, $query||$sid ) colas@0: colas@0: =head2 new( $dsn, $query||$sid, \%dsn_args ) colas@0: colas@0: Constructor. Returns new session object, or undef on failure. Error message is accessible through L. If called on an already initialized session will re-initialize the session based on already configured object. This is only useful after a call to L. colas@0: colas@0: Can accept up to three arguments, $dsn - Data Source Name, $query||$sid - query object OR a string representing session id, and finally, \%dsn_args, arguments used by $dsn components. colas@0: colas@0: If called without any arguments, $dsn defaults to I, $query||$sid defaults to C<< CGI->new() >>, and C<\%dsn_args> defaults to I. colas@0: colas@0: If called with a single argument, it will be treated either as C<$query> object, or C<$sid>, depending on its type. If argument is a string , C will treat it as session id and will attempt to retrieve the session from data store. If it fails, will create a new session id, which will be accessible through L. If argument is an object, L and L methods will be called on that object to recover a potential C<$sid> and retrieve it from data store. If it fails, C will create a new session id, which will be accessible through L. C will define the name of the query parameter and/or cookie name to be requested, defaults to I. colas@0: colas@0: If called with two arguments first will be treated as $dsn, and second will be treated as $query or $sid or undef, depending on its type. Some examples of this syntax are: colas@0: colas@0: $s = CGI::Session->new("driver:mysql", undef); colas@0: $s = CGI::Session->new("driver:sqlite", $sid); colas@0: $s = CGI::Session->new("driver:db_file", $query); colas@0: $s = CGI::Session->new("serializer:storable;id:incr", $sid); colas@0: # etc... colas@0: colas@0: colas@0: Following data source components are supported: colas@0: colas@0: =over 4 colas@0: colas@0: =item * colas@0: colas@0: B - CGI::Session driver. Available drivers are L, L, L and L. Third party drivers are welcome. For driver specs consider L colas@0: colas@0: =item * colas@0: colas@0: B - serializer to be used to encode the data structure before saving colas@0: in the disk. Available serializers are L, L and L. Default serializer will use L. colas@0: colas@0: =item * colas@0: colas@0: B - ID generator to use when new session is to be created. Available ID generator is L colas@0: colas@0: =back colas@0: colas@0: For example, to get CGI::Session store its data using DB_File and serialize data using FreezeThaw: colas@0: colas@0: $s = new CGI::Session("driver:DB_File;serializer:FreezeThaw", undef); colas@0: colas@0: If called with three arguments, first two will be treated as in the previous example, and third argument will be C<\%dsn_args>, which will be passed to C<$dsn> components (namely, driver, serializer and id generators) for initialization purposes. Since all the $dsn components must initialize to some default value, this third argument should not be required for most drivers to operate properly. colas@0: colas@0: undef is acceptable as a valid placeholder to any of the above arguments, which will force default behavior. colas@0: colas@0: =head2 load() colas@0: colas@0: =head2 load($query||$sid) colas@0: colas@0: =head2 load($dsn, $query||$sid) colas@0: colas@0: =head2 load($dsn, $query, \%dsn_args); colas@0: colas@0: Accepts the same arguments as new(), and also returns a new session object, or colas@0: undef on failure. The difference is, L can create new session if colas@0: it detects expired and non-existing sessions, but C does not. colas@0: colas@0: C is useful to detect expired or non-existing sessions without forcing the library to create new sessions. So now you can do something like this: colas@0: colas@0: $s = CGI::Session->load() or die CGI::Session->errstr(); colas@0: if ( $s->is_expired ) { colas@0: print $s->header(), colas@0: $cgi->start_html(), colas@0: $cgi->p("Your session timed out! Refresh the screen to start new session!") colas@0: $cgi->end_html(); colas@0: exit(0); colas@0: } colas@0: colas@0: if ( $s->is_empty ) { colas@0: $s = $s->new() or die $s->errstr; colas@0: } colas@0: colas@0: Notice, all I sessions are empty, but not all I sessions are expired! colas@0: colas@0: colas@0: =head2 id() colas@0: colas@0: Returns effective ID for a session. Since effective ID and claimed ID can differ, valid session id should always colas@0: be retrieved using this method. colas@0: colas@0: =head2 param($name) colas@0: colas@0: =head2 param(-name=E$name) colas@0: colas@0: Used in either of the above syntax returns a session parameter set to $name or undef if it doesn't exist. If it's called on a deleted method param() will issue a warning but return value is not defined. colas@0: colas@0: =head2 param($name, $value) colas@0: colas@0: =head2 param(-name=E$name, -value=E$value) colas@0: colas@0: Used in either of the above syntax assigns a new value to $name parameter, colas@0: which can later be retrieved with previously introduced param() syntax. C<$value> colas@0: may be a scalar, arrayref or hashref. colas@0: colas@0: Attempts to set parameter names that start with I<_SESSION_> will trigger colas@0: a warning and undef will be returned. colas@0: colas@0: =head2 param_hashref() colas@0: colas@0: B. Use L instead. colas@0: colas@0: =head2 dataref() colas@0: colas@0: Returns reference to session's data table: colas@0: colas@0: $params = $s->dataref(); colas@0: $sid = $params->{_SESSION_ID}; colas@0: $name= $params->{name}; colas@0: # etc... colas@0: colas@0: Useful for having all session data in a hashref, but too risky to update. colas@0: colas@0: =head2 save_param() colas@0: colas@0: =head2 save_param($query) colas@0: colas@0: =head2 save_param($query, \@@list) colas@0: colas@0: Saves query parameters to session object. In other words, it's the same as calling L for every single query parameter returned by C<< $query->param() >>. The first argument, if present, should be either CGI object or any object which can provide param() method. If it's undef, defaults to the return value of L, which returns C<< CGI->new >>. If second argument is present and is a reference to an array, only those query parameters found in the array will be stored in the session. undef is a valid placeholder for any argument to force default behavior. colas@0: colas@0: =head2 load_param() colas@0: colas@0: =head2 load_param($query) colas@0: colas@0: =head2 load_param($query, \@@list) colas@0: colas@0: Loads session parameters into a query object. The first argument, if present, should be query object, or any other object which can provide param() method. If second argument is present and is a reference to an array, only parameters found in that array will be loaded to the query object. colas@0: colas@0: =head2 clear() colas@0: colas@0: =head2 clear('field') colas@0: colas@0: =head2 clear(\@@list) colas@0: colas@0: Clears parameters from the session object. colas@0: colas@0: With no parameters, all fields are cleared. If passed a single parameter or a colas@0: reference to an array, only the named parameters are cleared. colas@0: colas@0: =head2 flush() colas@0: colas@0: Synchronizes data in memory with the copy serialized by the driver. Call flush() colas@0: if you need to access the session from outside the current session object. You should colas@0: at least call flush() before your program exits. colas@0: colas@0: As a last resort, CGI::Session will automatically call flush for you just colas@0: before the program terminates or session object goes out of scope. This automatic colas@0: behavior was the recommended behavior until the 4.x series. Automatic flushing colas@0: has since proven to be unreliable, and in some cases is now required in places colas@0: that worked with 3.x. For further details see: colas@0: colas@0: http://rt.cpan.org/Ticket/Display.html?id=17541 colas@0: http://rt.cpan.org/Ticket/Display.html?id=17299 colas@0: colas@0: =head2 atime() colas@0: colas@0: Read-only method. Returns the last access time of the session in seconds from epoch. This time is used internally while colas@0: auto-expiring sessions and/or session parameters. colas@0: colas@0: =head2 ctime() colas@0: colas@0: Read-only method. Returns the time when the session was first created in seconds from epoch. colas@0: colas@0: =head2 expire() colas@0: colas@0: =head2 expire($time) colas@0: colas@0: =head2 expire($param, $time) colas@0: colas@0: Sets expiration interval relative to L. colas@0: colas@0: If used with no arguments, returns the expiration interval if it was ever set. If no expiration was ever set, returns undef. For backwards compatibility, a method named C does the same thing. colas@0: colas@0: Second form sets an expiration time. This value is checked when previously stored session is asked to be retrieved, and if its expiration interval has passed, it will be expunged from the disk immediately. Passing 0 cancels expiration. colas@0: colas@0: By using the third syntax you can set the expiration interval for a particular colas@0: session parameter, say I<~logged-in>. This would cause the library call clear() colas@0: on the parameter when its time is up. Note it only makes sense to set this value to colas@0: something I than when the whole session expires. Passing 0 cancels expiration. colas@0: colas@0: All the time values should be given in the form of seconds. Following keywords are also supported for your convenience: colas@0: colas@0: +-----------+---------------+ colas@0: | alias | meaning | colas@0: +-----------+---------------+ colas@0: | s | Second | colas@0: | m | Minute | colas@0: | h | Hour | colas@0: | d | Day | colas@0: | w | Week | colas@0: | M | Month | colas@0: | y | Year | colas@0: +-----------+---------------+ colas@0: colas@0: Examples: colas@0: colas@0: $session->expire("2h"); # expires in two hours colas@0: $session->expire(0); # cancel expiration colas@0: $session->expire("~logged-in", "10m"); # expires '~logged-in' parameter after 10 idle minutes colas@0: colas@0: Note: all the expiration times are relative to session's last access time, not to its creation time. To expire a session immediately, call L. To expire a specific session parameter immediately, call L. colas@0: colas@0: colas@0: =head2 is_new() colas@0: colas@0: Returns true only for a brand new session. colas@0: colas@0: =head2 is_expired() colas@0: colas@0: Tests whether session initialized using L is to be expired. This method works only on sessions initialized with load(): colas@0: colas@0: $s = CGI::Session->load() or die CGI::Session->errstr; colas@0: if ( $s->is_expired ) { colas@0: die "Your session expired. Please refresh"; colas@0: } colas@0: if ( $s->is_empty ) { colas@0: $s = $s->new() or die $s->errstr; colas@0: } colas@0: colas@0: colas@0: =head2 is_empty() colas@0: colas@0: Returns true for sessions that are empty. It's preferred way of testing whether requested session was loaded successfully or not: colas@0: colas@0: $s = CGI::Session->load($sid); colas@0: if ( $s->is_empty ) { colas@0: $s = $s->new(); colas@0: } colas@0: colas@0: Actually, the above code is nothing but waste. The same effect could've been achieved by saying: colas@0: colas@0: $s = CGI::Session->new( $sid ); colas@0: colas@0: L is useful only if you wanted to catch requests for expired sessions, and create new session afterwards. See L for an example. colas@0: colas@0: =head2 delete() colas@0: colas@0: Deletes a session from the data store and empties session data from memory, completely, so subsequent read/write requests on the same object will fail. Technically speaking, it will only set object's status to I and will trigger L, and flush() will do the actual removal. colas@0: colas@0: =head2 find( \&code ) colas@0: colas@0: =head2 find( $dsn, \&code ) colas@0: colas@0: =head2 find( $dsn, \&code, \%dsn_args ) colas@0: colas@0: Experimental feature. Executes \&code for every session object stored in disk, passing initialized CGI::Session object as the first argument of \&code. Useful for housekeeping purposes, such as for removing expired sessions. Following line, for instance, will remove sessions already expired, but are still in disk: colas@0: colas@0: The following line, for instance, will remove sessions already expired, but which are still on disk: colas@0: colas@0: CGI::Session->find( sub {} ); colas@0: colas@0: Notice, above \&code didn't have to do anything, because load(), which is called to initialize sessions inside find(), will automatically remove expired sessions. Following example will remove all the objects that are 10+ days old: colas@0: colas@0: CGI::Session->find( \&purge ); colas@0: sub purge { colas@0: my ($session) = @@_; colas@0: next if $session->is_empty; # <-- already expired?! colas@0: if ( ($session->ctime + 3600*240) <= time() ) { colas@0: $session->delete() or warn "couldn't remove " . $session->id . ": " . $session->errstr; colas@0: } colas@0: } colas@0: colas@0: B: find will not change the modification or access times on the sessions it returns. colas@0: colas@0: Explanation of the 3 parameters to C: colas@0: colas@0: =over 4 colas@0: colas@0: =item $dsn colas@0: colas@0: This is the DSN (Data Source Name) used by CGI::Session to control what type of colas@0: sessions you previously created and what type of sessions you now wish method colas@0: C to pass to your callback. colas@0: colas@0: The default value is defined above, in the docs for method C, and is colas@0: 'driver:file;serializer:default;id:md5'. colas@0: colas@0: Do not confuse this DSN with the DSN arguments mentioned just below, under \%dsn_args. colas@0: colas@0: =item \&code colas@0: colas@0: This is the callback provided by you (i.e. the caller of method C) colas@0: which is called by CGI::Session once for each session found by method C colas@0: which matches the given $dsn. colas@0: colas@0: There is no default value for this coderef. colas@0: colas@0: When your callback is actually called, the only parameter is a session. If you colas@0: want to call a subroutine you already have with more parameters, you can colas@0: achieve this by creating an anonymous subroutine that calls your subroutine colas@0: with the parameters you want. For example: colas@0: colas@0: CGI::Session->find($dsn, sub { my_subroutine( @@_, 'param 1', 'param 2' ) } ); colas@0: CGI::Session->find($dsn, sub { $coderef->( @@_, $extra_arg ) } ); colas@0: colas@0: Or if you wish, you can define a sub generator as such: colas@0: colas@0: sub coderef_with_args { colas@0: my ( $coderef, @@params ) = @@_; colas@0: return sub { $coderef->( @@_, @@params ) }; colas@0: } colas@0: colas@0: CGI::Session->find($dsn, coderef_with_args( $coderef, 'param 1', 'param 2' ) ); colas@0: colas@0: =item \%dsn_args colas@0: colas@0: If your $dsn uses file-based storage, then this hashref might contain keys such as: colas@0: colas@0: { colas@0: Directory => Value 1, colas@0: NoFlock => Value 2, colas@0: UMask => Value 3 colas@0: } colas@0: colas@0: If your $dsn uses db-based storage, then this hashref contains (up to) 3 keys, and looks like: colas@0: colas@0: { colas@0: DataSource => Value 1, colas@0: User => Value 2, colas@0: Password => Value 3 colas@0: } colas@0: colas@0: These 3 form the DSN, username and password used by DBI to control access to your database server, colas@0: and hence are only relevant when using db-based sessions. colas@0: colas@0: The default value of this hashref is undef. colas@0: colas@0: =back colas@0: colas@0: B find() is meant to be convenient, not necessarily efficient. It's best suited in cron scripts. colas@0: colas@0: =head1 MISCELLANEOUS METHODS colas@0: colas@0: =head2 remote_addr() colas@0: colas@0: Returns the remote address of the user who created the session for the first time. Returns undef if variable REMOTE_ADDR wasn't present in the environment when the session was created. colas@0: colas@0: colas@0: =head2 errstr() colas@0: colas@0: Class method. Returns last error message from the library. colas@0: colas@0: =head2 dump() colas@0: colas@0: Returns a dump of the session object. Useful for debugging purposes only. colas@0: colas@0: =head2 header() colas@0: colas@0: Replacement for L's header() method. Without this method, you usually need to create a CGI::Cookie object and send it as part of the HTTP header: colas@0: colas@0: $cookie = CGI::Cookie->new(-name=>$session->name, -value=>$session->id); colas@0: print $cgi->header(-cookie=>$cookie); colas@0: colas@0: You can minimize the above into: colas@0: colas@0: print $session->header(); colas@0: colas@0: It will retrieve the name of the session cookie from C<$session->name()> which defaults to C<$CGI::Session::NAME>. If you want to use a different name for your session cookie, do something like following before creating session object: colas@0: colas@0: CGI::Session->name("MY_SID"); colas@0: $session = new CGI::Session(undef, $cgi, \%attrs); colas@0: colas@0: Now, $session->header() uses "MY_SID" as a name for the session cookie. colas@0: colas@0: =head2 query() colas@0: colas@0: Returns query object associated with current session object. Default query object class is L. colas@0: colas@0: =head2 DEPRECATED METHODS colas@0: colas@0: These methods exist solely for for compatibility with CGI::Session 3.x. colas@0: colas@0: =head3 close() colas@0: colas@0: Closes the session. Using flush() is recommended instead, since that's exactly what a call colas@0: to close() does now. colas@0: colas@0: =head1 DISTRIBUTION colas@0: colas@0: CGI::Session consists of several components such as L, L and L. This section lists what is available. colas@0: colas@0: =head2 DRIVERS colas@0: colas@0: Following drivers are included in the standard distribution: colas@0: colas@0: =over 4 colas@0: colas@0: =item * colas@0: colas@0: L - default driver for storing session data in plain files. Full name: B colas@0: colas@0: =item * colas@0: colas@0: L - for storing session data in BerkelyDB. Requires: L. colas@0: Full name: B colas@0: colas@0: =item * colas@0: colas@0: L - for storing session data in MySQL tables. Requires L and L. colas@0: Full name: B colas@0: colas@0: =item * colas@0: colas@0: L - for storing session data in SQLite. Requires L and L. colas@0: Full name: B colas@0: colas@0: =back colas@0: colas@0: =head2 SERIALIZERS colas@0: colas@0: =over 4 colas@0: colas@0: =item * colas@0: colas@0: L - default data serializer. Uses standard L. colas@0: Full name: B. colas@0: colas@0: =item * colas@0: colas@0: L - serializes data using L. Requires L. colas@0: Full name: B. colas@0: colas@0: =item * colas@0: colas@0: L - serializes data using L. Requires L. colas@0: Full name: B colas@0: colas@0: =item * colas@0: colas@0: L - serializes data using YAML. Requires L or L. colas@0: Full name: B colas@0: colas@0: =item * colas@0: colas@0: L - serializes data using JSON. Requires L. colas@0: Full name: B colas@0: colas@0: =back colas@0: colas@0: =head2 ID GENERATORS colas@0: colas@0: Following ID generators are available: colas@0: colas@0: =over 4 colas@0: colas@0: =item * colas@0: colas@0: L - generates 32 character long hexadecimal string. Requires L. colas@0: Full name: B. colas@0: colas@0: =item * colas@0: colas@0: L - generates incremental session ids. colas@0: colas@0: =item * colas@0: colas@0: L - generates static session ids. B colas@0: colas@0: =back colas@0: colas@0: colas@0: =head1 CREDITS colas@0: colas@0: CGI::Session evolved to what it is today with the help of following developers. The list doesn't follow any strict order, but somewhat chronological. Specifics can be found in F file colas@0: colas@0: =over 4 colas@0: colas@0: =item Andy Lester colas@0: colas@0: =item Brian King Emrbbking@@mac.comE colas@0: colas@0: =item Olivier Dragon Edragon@@shadnet.shad.caE colas@0: colas@0: =item Adam Jacob Eadam@@sysadminsith.orgE colas@0: colas@0: =item Igor Plisco Eigor@@plisco.ruE colas@0: colas@0: =item Mark Stosberg colas@0: colas@0: =item Matt LeBlanc Emleblanc@@cpan.orgE colas@0: colas@0: =item Shawn Sorichetti colas@0: colas@0: =back colas@0: colas@0: =head1 COPYRIGHT colas@0: colas@0: Copyright (C) 2001-2005 Sherzod Ruzmetov Esherzodr@@cpan.orgE. All rights reserved. colas@0: This library is free software. You can modify and or distribute it under the same terms as Perl itself. colas@0: colas@0: =head1 PUBLIC CODE REPOSITORY colas@0: colas@0: You can see what the developers have been up to since the last release by colas@0: checking out the code repository. You can browse the Subversion repository from here: colas@0: colas@0: http://svn.cromedome.net/ colas@0: colas@0: Or check it directly with C from here: colas@0: colas@0: svn://svn.cromedome.net/CGI-Session colas@0: colas@0: =head1 SUPPORT colas@0: colas@0: If you need help using CGI::Session consider the mailing list. You can ask the list by sending your questions to colas@0: cgi-session-user@@lists.sourceforge.net . colas@0: colas@0: You can subscribe to the mailing list at https://lists.sourceforge.net/lists/listinfo/cgi-session-user . colas@0: colas@0: Bug reports can be submitted at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Session colas@0: colas@0: =head1 AUTHOR colas@0: colas@0: Sherzod Ruzmetov Esherzodr@@cpan.orgE, http://author.handalak.com/ colas@0: colas@0: Mark Stosberg became a co-maintainer during the development of 4.0. C. colas@0: colas@0: =head1 SEE ALSO colas@0: colas@0: =over 4 colas@0: colas@0: =item * colas@0: colas@0: L - extended CGI::Session manual colas@0: colas@0: =item * colas@0: colas@0: B - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt colas@0: colas@0: =item * colas@0: colas@0: L - standard CGI library colas@0: colas@0: =item * colas@0: colas@0: L - another fine alternative to CGI::Session colas@0: colas@0: =back colas@0: colas@0: @