- if (TheSession == NULL) {
- lprintf(3, "Creating a new session\n");
- TheSession = (wcsession *)
- malloc(sizeof(wcsession));
- memset(TheSession, 0, sizeof(wcsession));
- TheSession->Hdr = &Hdr;
- TheSession->SessionKey = Hdr.SessionKey;
- TheSession->serv_sock = (-1);
- TheSession->chat_sock = (-1);
-
- /* If we're recreating a session that expired, it's best to give it the same
- * session number that it had before. The client browser ought to pick up
- * the new session number and start using it, but in some rare situations it
- * doesn't, and that's a Bad Thing because it causes lots of spurious sessions
- * to get created.
- */
- if (Hdr.desired_session == 0) {
- TheSession->wc_session = GenerateSessionID();
- }
- else {
- TheSession->wc_session = Hdr.desired_session;
- }
-
- pthread_setspecific(MyConKey, (void *)TheSession);
- session_new_modules(TheSession);
+ if (StrLength(Hdr->c_language) > 0) {
+ syslog(9, "Session cookie requests language '%s'", ChrPtr(Hdr->c_language));
+ set_selected_language(ChrPtr(Hdr->c_language));
+ go_selected_language();
+ }