# createSession() bug

**URL:** <https://forum.wixstudio.com/t/createsession-bug/10183>\
**Category:** Ask the community\
**Tags:** wix-bookings, question, code\
**Created:** [January 15, 2022, 6:33pm UTC](https://forum.wixstudio.com/t/createsession-bug/10183 "2022-01-15T18:33:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![terjek-andris](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/terjek-andris/32/24074_2.png) [@terjek-andris](https://forum.wixstudio.com/u/terjek-andris)\
**Post date:** [January 15, 2022, 6:33pm UTC](https://forum.wixstudio.com/t/createsession-bug/10183/1 "2022-01-15T18:33:59Z")

</div>

Hi all!  
I’m using wix bookings backend on my site to create sessions from the code.  
Unfortunately it has a bug  
I’m using the following code:

```javascript
$w("#button5").onClick(()=>{
        let sessionInfo={
            scheduleId:'bcaad087-c2b7-4158-a4c2-2afe5ab845c6',
            start:{ timestamp: new Date(2022, 0, 28, 9) },
            end:{ timestamp: new Date(2022, 0, 28, 10, 30) },
        }
        myCreateSession(sessionInfo, {suppressAuth:true}).then((session)=>{
            console.log(session);
        })
        .catch((err)=>{
            console.log('SOMETHING WENT WRONG', err);
        })
})

```

The backend function looks like this:

```javascript
export function myCreateSession(sessionInfo, options){
    return sessions.createSession(sessionInfo, options);
}

```

It creates a session that from the sessions query looks just like any other session that was added trough the calendar.  
However when i look at it from the calendar it seems to be missing the location info, and the staff member info.

It should inherit thoose from the schedule, but it doesn’t, and it results in the following error when somebody tries to book the session:

 ![](https://us1.discourse-cdn.com/wix/original/3X/9/b/9b433baece28cec02c26f61cefe7c46f4dcf7734.png)

I’m looking for ideas for solving this bug, or somehow getting around it.  
Thanks in advance!
